commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1494409 - /commons/sandbox/commons-staging-plugin/trunk/src/main/java/org/apache/commons/plugins/staging/AbstractExecMojo.java
Date Wed, 19 Jun 2013 01:24:42 GMT
Author: sebb
Date: Wed Jun 19 01:24:42 2013
New Revision: 1494409

URL: http://svn.apache.org/r1494409
Log:
Move misplaced statement; show cmd if exec fails

Modified:
    commons/sandbox/commons-staging-plugin/trunk/src/main/java/org/apache/commons/plugins/staging/AbstractExecMojo.java

Modified: commons/sandbox/commons-staging-plugin/trunk/src/main/java/org/apache/commons/plugins/staging/AbstractExecMojo.java
URL: http://svn.apache.org/viewvc/commons/sandbox/commons-staging-plugin/trunk/src/main/java/org/apache/commons/plugins/staging/AbstractExecMojo.java?rev=1494409&r1=1494408&r2=1494409&view=diff
==============================================================================
--- commons/sandbox/commons-staging-plugin/trunk/src/main/java/org/apache/commons/plugins/staging/AbstractExecMojo.java
(original)
+++ commons/sandbox/commons-staging-plugin/trunk/src/main/java/org/apache/commons/plugins/staging/AbstractExecMojo.java
Wed Jun 19 01:24:42 2013
@@ -96,7 +96,6 @@ public abstract class AbstractExecMojo  
         // Of course that won't work for move between dev and release
         cmd.createArg().setValue( "--extra-args" );
         cmd.createArg().setFile( script );
-        cmd.createArg().setValue( "--username" );
         String cmdLine;
         if (isNonEmpty(serverName)) {
             log.warn("Using authentication from settings.xml: " + serverName);
@@ -104,9 +103,10 @@ public abstract class AbstractExecMojo  
             if (server == null) {
                 throw new MojoExecutionException("Could not find server name " + serverName);
             }
+            cmd.createArg().setValue( "--username" );
             cmd.createArg().setValue( server.getUsername() );
             cmd.createArg().setValue( "--password" );
-            cmdLine = cmd.toString();
+            cmdLine = cmd.toString(); // Don't include password in output
             try {
                 final SecDispatcher sd = (SecDispatcher) container.lookup( SecDispatcher.ROLE,
"maven" );
                 cmd.createArg().setValue( sd.decrypt( server.getPassword() ) );
@@ -128,7 +128,7 @@ public abstract class AbstractExecMojo  
 
             if ( exitCode != 0 )
             {
-                throw new MojoExecutionException( "Exit code: " + exitCode );
+                throw new MojoExecutionException( "Exit code: " + exitCode + "\n"+ cmdLine);
             }
         }
         catch ( CommandLineException e )



Mime
View raw message