maven-changes-plugin忽略配置

时间:2017-01-30 19:43:41

标签: maven jira maven-changes-plugin

我正在尝试使用maven-changes-plugin从Jira生成发行说明。但是,当我在maven调试模式下检查日志时,似乎忽略了指定的配置。

这里是顶级pom.xml中的插件代码:

<issueManagement>
    <system>Jira</system>
    <url>my-jira-url</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>my-jira-user-name</jiraUser>
                <jiraPassword>my-jira-password</jiraPassword>
                <component>component-name</component>
                <resolutionIds>cust-resolution-id</resolutionIds>
                <statusIds>custom-status-id</statusIds>
            </configuration>
        </plugin>
    </plugins>
</reporting>

此命令行执行报告:更改:jira-report

这是来自maven日志记录:

[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-changes-  plugin:2.12.1:jira-report (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <basedir>${basedir}</basedir>
  <columnNames default-value="Key,Summary,Status,Resolution,Assignee"/>
  <forceRss default-value="false"/>
  <inputEncoding default-value="${project.build.sourceEncoding}">${encoding} </inputEncoding>
  <jiraDatePattern default-value="EEE, d MMM yyyy HH:mm:ss Z"/>
  <jiraXmlPath default-value="${project.build.directory}/jira-results.xml"/>
  <localRepository>${localRepository}</localRepository>
  <mavenSession default-value="${session}"/>
  <maxEntries default-value="100"/>
  <onlyCurrentVersion default-value="false"/>
  <outputDirectory default-value="${project.reporting.outputDirectory}"/>
  <outputEncoding default-value="${project.reporting.outputEncoding}">${outputEncoding}</outputEncoding>
  <project default-value="${project}"/>
  <resolutionIds default-value="Fixed"/>
  <runOnlyAtExecutionRoot default-value="false">${changes.runOnlyAtExecutionRoot}</runOnlyAtExecutionRoot>
  <settings default-value="${settings}"/>
  <skip default-value="false">${changes.jira.skip}</skip>
  <sortColumnNames default-value="Priority DESC, Created DESC"/>
  <statusIds default-value="Closed"/>
  <useJql default-value="false">${changes.useJql}</useJql>
</configuration>

更多日志记录:

[DEBUG] RuntimeInstance successfully initialized.
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-changes-plugin:2.12.1:jira-report' with basic configurator -->
[DEBUG]   (f) basedir = /path/to/basedir
[DEBUG]   (f) columnNames = Key,Summary,Status,Resolution,Assignee
[DEBUG]   (f) forceRss = false
[DEBUG]   (f) jiraDatePattern = EEE, d MMM yyyy HH:mm:ss Z
[DEBUG]   (f) jiraXmlPath = /path/to/target/jira-results.xml
[DEBUG]   (f) localRepository =       id: local
      url: file:///path/to/.m2/repository/
   layout: default
snapshots: [enabled => true, update => always]
 releases: [enabled => true, update => always]

[DEBUG]   (f) mavenSession = org.apache.maven.execution.MavenSession@31e32ea2
[DEBUG]   (f) maxEntries = 100
[DEBUG]   (f) onlyCurrentVersion = false
[DEBUG]   (f) outputDirectory = /path/to/target/site
[DEBUG]   (f) project = MavenProject: /path/to/pom.xml
[DEBUG]   (f) resolutionIds = Fixed
[DEBUG]   (f) runOnlyAtExecutionRoot = false
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@5b5c0057
[DEBUG]   (f) skip = false
[DEBUG]   (f) sortColumnNames = Priority DESC, Created DESC
[DEBUG]   (f) statusIds = Closed
[DEBUG]   (f) useJql = false
[DEBUG] -- end configuration --

插件会尝试转到issueManagement元素中指定的url。但是由于忽略了配置,我得到了这个堆栈跟踪:

[WARNING] 
org.apache.maven.plugin.MojoFailureException: Could not find status Closed.
at org.apache.maven.plugin.jira.RestJiraDownloader.resolveOneItem(RestJiraDownloader.java:275)

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

有同样的问题 将配置部分移动到构建如下

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-changes-plugin</artifactId>
            <version>2.12.1</version>
            <configuration>
                <onlyCurrentVersion>true</onlyCurrentVersion>
                <statusIds>CLOSED,OPEN</statusIds>
                <useJql>true</useJql>
            </configuration>
        </plugin>       
    </plugins>
</build>