You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/09/02 15:11:33 UTC
[maven-changes-plugin] branch MCHANGES-340 created (now f36b6df)
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a change to branch MCHANGES-340
in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git.
at f36b6df MCHANGES-340 Support jira serverId configuration
This branch includes the following new commits:
new f36b6df MCHANGES-340 Support jira serverId configuration
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[maven-changes-plugin] 01/01: MCHANGES-340 Support jira serverId
configuration
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MCHANGES-340
in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git
commit f36b6dfafc8aca99d490ff21ee42ec025a12d228
Author: Matt Nelson <ma...@cerner.com>
AuthorDate: Tue Jun 30 12:55:38 2020 -0500
MCHANGES-340 Support jira serverId configuration
---
.../plugins/announcement/AnnouncementMojo.java | 23 +++++++++++++++++++---
.../org/apache/maven/plugins/jira/JiraMojo.java | 23 +++++++++++++++++++---
2 files changed, 40 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java b/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java
index 8766de6..a3a1197 100644
--- a/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java
+++ b/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java
@@ -48,6 +48,7 @@ import org.apache.maven.plugins.jira.JIRAIssueManagmentSystem;
import org.apache.maven.plugins.trac.TracDownloader;
import org.apache.maven.plugins.trac.TracIssueManagmentSystem;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.apache.velocity.Template;
@@ -305,6 +306,14 @@ public class AnnouncementMojo
private String jiraUser;
/**
+ * The settings.xml server id to be used for authentication into a private JIRA installation.
+ *
+ * @since 3.0.0
+ */
+ @Parameter( property = "changes.jiraServerId" )
+ private String jiraServerId;
+
+ /**
* Path to the JIRA XML file, which will be parsed.
*/
@Parameter( defaultValue = "${project.build.directory}/jira-announcement.xml", required = true, readonly = true )
@@ -767,9 +776,17 @@ public class AnnouncementMojo
jiraDownloader.setFilter( filter );
- jiraDownloader.setJiraUser( jiraUser );
-
- jiraDownloader.setJiraPassword( jiraPassword );
+ if ( jiraServerId != null )
+ {
+ final Server server = mavenSession.getSettings().getServer( jiraServerId );
+ jiraDownloader.setJiraUser( server.getUsername() );
+ jiraDownloader.setJiraPassword( server.getPassword() );
+ }
+ else
+ {
+ jiraDownloader.setJiraUser( jiraUser );
+ jiraDownloader.setJiraPassword( jiraPassword );
+ }
jiraDownloader.setUseJql( useJql );
diff --git a/src/main/java/org/apache/maven/plugins/jira/JiraMojo.java b/src/main/java/org/apache/maven/plugins/jira/JiraMojo.java
index 1d9c317..a06053b 100644
--- a/src/main/java/org/apache/maven/plugins/jira/JiraMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jira/JiraMojo.java
@@ -36,6 +36,7 @@ import org.apache.maven.plugins.issues.IssueUtils;
import org.apache.maven.plugins.issues.IssuesReportGenerator;
import org.apache.maven.plugins.issues.IssuesReportHelper;
import org.apache.maven.reporting.MavenReportException;
+import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
/**
@@ -150,6 +151,14 @@ public class JiraMojo
private String jiraUser;
/**
+ * The settings.xml server id to be used for authentication into a private JIRA installation.
+ *
+ * @since 3.0.0
+ */
+ @Parameter( property = "changes.jiraServerId" )
+ private String jiraServerId;
+
+ /**
* Path to the JIRA XML file, which will be parsed.
*/
@Parameter( defaultValue = "${project.build.directory}/jira-results.xml", required = true, readonly = true )
@@ -430,9 +439,17 @@ public class JiraMojo
issueDownloader.setJiraDatePattern( jiraDatePattern );
- issueDownloader.setJiraUser( jiraUser );
-
- issueDownloader.setJiraPassword( jiraPassword );
+ if ( jiraServerId != null )
+ {
+ final Server server = mavenSession.getSettings().getServer( jiraServerId );
+ issueDownloader.setJiraUser( server.getUsername() );
+ issueDownloader.setJiraPassword( server.getPassword() );
+ }
+ else
+ {
+ issueDownloader.setJiraUser( jiraUser );
+ issueDownloader.setJiraPassword( jiraPassword );
+ }
issueDownloader.setTypeIds( typeIds );