You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2011/11/21 17:44:52 UTC
svn commit: r1204586 -
/maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/src/main/java/org/apache/maven/plugins/patchtracker/AbstractPatchMojo.java
Author: olamy
Date: Mon Nov 21 16:44:51 2011
New Revision: 1204586
URL: http://svn.apache.org/viewvc?rev=1204586&view=rev
Log:
the jira server id for settings can be in a pom properties too
Modified:
maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/src/main/java/org/apache/maven/plugins/patchtracker/AbstractPatchMojo.java
Modified: maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/src/main/java/org/apache/maven/plugins/patchtracker/AbstractPatchMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/src/main/java/org/apache/maven/plugins/patchtracker/AbstractPatchMojo.java?rev=1204586&r1=1204585&r2=1204586&view=diff
==============================================================================
--- maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/src/main/java/org/apache/maven/plugins/patchtracker/AbstractPatchMojo.java (original)
+++ maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/src/main/java/org/apache/maven/plugins/patchtracker/AbstractPatchMojo.java Mon Nov 21 16:44:51 2011
@@ -235,17 +235,27 @@ public abstract class AbstractPatchMojo
"you must configure a patch summary or at least use interactive mode", null, false );
}
+ protected String getServerId()
+ {
+ String serverIdFromPom = (String) project.getProperties().get( "patch.tracker.serverId" );
+ if ( StringUtils.isNotEmpty( serverIdFromPom ) )
+ {
+ return serverIdFromPom;
+ }
+ return serverId;
+ }
+
protected String getPatchTrackerUsername()
throws PrompterException, MojoExecutionException
{
String value = null;
- if ( StringUtils.isNotEmpty( serverId ) )
+ if ( StringUtils.isNotEmpty( getServerId() ) )
{
- Server server = getServer( serverId );
+ Server server = getServer( getServerId() );
if ( server == null )
{
- getLog().warn( "no server found in your settings.xml with id:" + serverId );
+ getLog().warn( "no server found in your settings.xml with id:" + getServerId() );
}
else
{
@@ -270,12 +280,12 @@ public abstract class AbstractPatchMojo
{
String value = null;
- if ( StringUtils.isNotEmpty( serverId ) )
+ if ( StringUtils.isNotEmpty( getServerId() ) )
{
- Server server = getServer( serverId );
+ Server server = getServer( getServerId() );
if ( server == null )
{
- getLog().warn( "no server found in your settings.xml with id:" + serverId );
+ getLog().warn( "no server found in your settings.xml with id:" + getServerId() );
}
else
{