1

I am trying to use the maven-changes-plugin to generate a release notes from Jira. However, when I inspect the logs in the maven debug mode, the specified configuration seems to be ignored.

Here's the plugin code in the top-level 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>

This command line executes the report: changes:jira-report

This is from the maven logging:

[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>

More logging:

[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 --

The plugin does attempt to go to the url specified in the issueManagement element. But since the configuration is ignored, I get this stacktrace:

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

Any help would be appreciated!

4

1 回答 1

1

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

<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>
于 2017-04-08T11:48:13.797 回答