Reputation: 1351
How do I configure my changes.xml and pom file in order to link JIRA issue on the maven site. I am including the maven-changes plugin. But I want to see how do we add for JIRA as I add the following for bugzilla.
JIRA https://bugs.abc.corp/enter_bug.cgi?product=${project.groupId}&component=${project.artifactId}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.2</version>
<configuration>
<issueLinkTemplatePerSystem>
<bugzilla><![CDATA[http://internal.bugtracker/show_bug.cgi?id=%ISSUE%]]></bugzilla>
<navigator><![CDATA[http://external.bugtracker/?cr=%ISSUE%]]></navigator>
</issueLinkTemplatePerSystem>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
Upvotes: 1
Views: 637
Reputation: 437
This is how I got it working for bugzilla and jira. So you just need to add an extra row - You may put the url instead of the variable "%"
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.9</version>
<configuration>
<issueLinkTemplatePerSystem>
<jira><![CDATA[%URL%/browse/%ISSUE%]]></jira>
<bugzilla><![CDATA[http://bugzill.url/show_bug.cgi?id=%ISSUE%]]></bugzilla>
</issueLinkTemplatePerSystem>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
Upvotes: 0
Reputation: 1447
Of course, it is a great idea to take a look at the docs, as Raghuram suggested. JIRA is one of the pre-configured systems, and its standard URL for issues is %URL%/%ISSUE%.
From the XML snippet I understand you have added the issueLinkTemplatePerSystem configuration in the reporting section of the pom file. I have been struggling with this until I have tried adding that configuration to the pluginManagement section instead:
<project>
<!-- ... -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.9</version>
<configuration>
<issueLinkTemplatePerSystem>
<system1>https://a.b.c/ticket?id=%ISSUE%</system1>
<system2>https://foo.bar/baz/%ISSUE%/view</system2>
</issueLinkTemplatePerSystem>
</configuration>
</plugin>
<!-- ... -->
</plugins>
</pluginManagement>
<!-- ... -->
</build>
<!-- ... -->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<!-- ... -->
</project>
Then it worked like a charm, being able to use several different systems (with different template URLs) in changes.xml. I did not find this in the documentation.
Hint: try adding the option --debug (mvn --debug clean changes:changes-report) to see the IMSs taken by the plugin from the configuration.
Upvotes: 1
Reputation: 52665
Perhaps you should try the steps documented in Linking to Your Issue Management System section of the usage page of the plugin.
According to it, from version 2.4, the plugin comes pre-configured for a bunch of issue tracking systems, including jira. Quoting from the page,
If you use the issue attribute in your changes.xml file and have the element configured in your pom.xml, the report will contain links to the issues in your issue management system.
Upvotes: 0