博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

JIRA开发(三):插件开发基本命令

Posted on 2013-01-18 17:49  Bruce Zhang  阅读(1463)  评论(1编辑  收藏  举报

1. 生成插件框架;

$SDK_HOME/bin/atlas-create-jira-plugin \
--artifactId myplugin \
--groupId com.mycompany.jira.plugins \
--version 4.2.0 \
--package com.mycompany.jira.plugins.myplugin
--non-interactive

2.构建/发布插件(编译/打包/发布)

(1)运行$SDK_HOME/bin/atlas-package产生插件JAR包,然后直接"Administration->Plugin->Manage Plugin->Upload Plugin"上传并安装插件。

(2)运行$SDK_HOME/bin/atlas-run以单独运行插件专用的JIRA环境,并自动发布插件,配合$SDK_HOME/bin/atlas-cli,可以在开发环境快速发布插件。

        使用说明如下:

  Using atlas-run and atlas-cli
  The SDK also provides another way to build and deploy a JIRA plugin. If you type:
    $SDK_HOME/bin/atlas-run
  instead of atlas-package, then a brand new instance of JIRA is automatically configured
  in the target directory. Then the plugin .jar file is deployed there and the new JIRA
  instance is started up at http://localhost:2990/jira. You can log in with the user name
  admin and password admin and test your plugin directly there.
  This second approach takes a little longer to start up the first time, but you don’t have
  to configure anything such as a license. The other benefit of this approach is that in
  some cases it allows for much faster redeployment of plugins. If you open another
  separate window from the same top-level directory and type:
    $SDK_HOME/bin/atlas-cli
  then a maven2> prompt appears. Typing pi for “plugin install” at the prompt will rebuild
  and redeploy your plugin in a few seconds instead of the minute or so it can take to
  restart JIRA.
  This is the fastest way to develop plugins—but prior to JIRA 4.4, it only works if a
  plugin is using certain plugin module types. The list of which types do and do not work
  with pi can be found at http://confluence.atlassian.com/display/DEVNET/Plugins+that
  +Cannot+be+Reloaded+with+pi. The good news is that as of JIRA 4.4, almost all plugins
  can be reloaded using pi or from the Administration menu, which will save everyone
  a lot of time during development.