我正试图在Maven changes-plugin的帮助下通过Jira
获取发布说明。我的pom看起来像这样:
<issueManagement>
<system>Jira</system>
<url>https://url_to_jira</url>
</issueManagement>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.9</version>
<configuration>
<fixVersionIds>14876</fixVersionIds>
<jiraUser>myUser</jiraUser>
<jiraPassword>myPassword</jiraPassword>
<webUser>myUser</webUser>
<webPassword>myPassword</webPassword>
</configuration>
</plugin>
</plugins>
</reporting>
然后我调用mvn changes:jira-report
为我生成一个空的html页面。它总是警告我
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin.
[WARNING]
org.apache.maven.plugin.MojoFailureException: Could not find status Closed.
这没有什么帮助。使用mvn
运行-X
向我显示,由于某种原因,请求标头没有身份验证部分。
---------------------------
ID: 1
Address: https://url_to_jira/rest/api/2/serverInfo
Http-Method: GET
Content-Type: */*
Headers: {Accept=[application/json], Content-Type=[*/*]}
--------------------------------------
Feb 25, 2014 12:51:00 PM org.apache.cxf.interceptor.LoggingInIn
INFO: Inbound Message
----------------------------
ID: 1
Response-Code: 200
Encoding: UTF-8
Content-Type: application/json;charset=UTF-8
Headers: {Cache-Control=[no-cache, no-store, no-transform], con
Payload: {stuff}
--------------------------------------
Feb 25, 2014 12:51:00 PM org.apache.cxf.interceptor.LoggingOutI
INFO: Outbound Message
---------------------------
ID: 2
Address: https://url_to_jira/rest/api/2/status
Http-Method: GET
Content-Type: */*
Headers: {Accept=[application/json], Content-Type=[*/*]}
--------------------------------------
Feb 25, 2014 12:51:00 PM org.apache.cxf.interceptor.LoggingInIn
INFO: Inbound Message
----------------------------
ID: 2
Response-Code: 200
Encoding: UTF-8
Content-Type: application/json;charset=UTF-8
Headers: {//somestuff//, X-AUSERNAME=[anonymous]}
Payload: []
--------------------------------------
注意X-AUSERNAME=[anonymous]
- 部分。
所以它尝试获取状态列表并获取一个空列表,因为它甚至没有尝试使用Jira
验证自身,这是奇怪的,因为我提供了{{1}和我的pom中有密码的webUser
。
有什么想法吗?
答案 0 :(得分:0)
也许这可以回答你的问题: https://maven.apache.org/plugins/maven-changes-plugin/examples/customizing-jira-report.html
从JIRA 5.1开始,不再可能使用查询参数询问JIRA问题。如果您使用JIRA 5.1或更新版本,则必须添加此配置[...]
答案 1 :(得分:0)
原因是您安装的JIRA使用自定义状态ID。
我找到了解决方案。您应该转到下面的链接以获取resolution
和status
:
http://jira.xxx.com/rest/api/2/resolution/
http://jira.xxx.com/rest/api/2/status/
然后使用上面结果中的id
或name
来配置resolutionIds
和statusIds
:
<issueManagement>
<system>JIRA</system>
<url>http://jira.xxx.com/browse/PROJ_NAME</url>
</issueManagement>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.12.1</version>
<configuration>
<useJql>true</useJql>
<jiraUser>username</jiraUser>
<jiraPassword>password</jiraPassword>
<!--
<onlyCurrentVersion>true</onlyCurrentVersion>
-->
<!-- http://jira.xxx.com/rest/api/2/resolution/ -->
<!-- http://jira.xxx.com/rest/api/2/status/ -->
<resolutionIds>10010</resolutionIds>
<statusIds>10011</statusIds>
</configuration>
<reportSets>
<reportSet>
<reports>
<!--
<report>changes-report</report>
-->
<report>jira-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
您可以在management
- &gt;下以管理员身份更改设置issues
- &gt; issue properties
- &gt; statuses
或resolutions
菜单。
另请参阅:https://maven.apache.org/plugins/maven-changes-plugin/jira-report-mojo.html#statusIds