Jira 插件开发注意事项
- 插件中使用Restful模块时,在本地部署打包和运行时要在命令中加入特定的关键字
atlas-run -Dmaven.javadoc.skip=true
atlas-mvn package -Dmaven.javadoc.skip=true
- 在开发webwork模版的时候,修改页面资源文件配置,要以pluginkey:resourcekey的格式,pluginkey的位置在目录:
/target/classes/META-INF/MANIFEST.MF
打开文件找到Atlassian-Plugin-Key字段就是pluginkey,回到插件项目中修改即可
@Named
public class BatchExpertesPlanningWebworkAction extends JiraWebActionSupport
{
private static final Logger log = LoggerFactory.getLogger(BatchExpertesPlanningWebworkAction.class);
@Inject
private PageBuilderService pageBuilderService;
@Override
public String execute() throws Exception {
pageBuilderService.assembler().resources().requireWebResource(
"com.ceair.batchExpertes-plugin:batchExpertes-plugin-resources"
).requireWebResource(
"com.ceair.batchExpertes-plugin:batchExpertes-plugin-resources--planning"
);
return "batchExpertes-planning-success";
}
public void setPageBuilderService(PageBuilderService pageBuilderService) {
this.pageBuilderService = pageBuilderService;
}
}
- 首次使用atlas-mvn package 命令的时候报错,提示Unknown lifecycle phase error after entering the command
atlas-mvn eclipse:eclipse原因是atlas-mvn命令有问题,进入sdk安装目录进入/bin文件夹用编辑器打开atlas-mvn命令
# 注释下面这行
MVN_COMMAND=%%MVN_COMMAND:${mavenPluginName}=%MVN_PLUGIN%%%
# 添加下面这行
MVN_COMMAND=%%MVN_COMMAND:%%
重新运行该命令