You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/01/01 14:07:35 UTC

svn commit: r895004 - /maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java

Author: bentmann
Date: Fri Jan  1 13:07:35 2010
New Revision: 895004

URL: http://svn.apache.org/viewvc?rev=895004&view=rev
Log:
[MPATCH-11] Plugin generates faulty command line when originalFile and destFile parameters are used

Modified:
    maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java

Modified: maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java?rev=895004&r1=895003&r2=895004&view=diff
==============================================================================
--- maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java (original)
+++ maven/plugins/trunk/maven-patch-plugin/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java Fri Jan  1 13:07:35 2010
@@ -218,7 +218,8 @@
     private File originalFile;
 
     /**
-     * The output file which is the original file, plus modifications from the patch.
+     * The output file which is the original file, plus modifications from the patch. By default, the file(s) will be
+     * patched inplace.
      * 
      * @parameter
      */
@@ -565,19 +566,6 @@
 
         cli.setWorkingDirectory( targetDirectory.getAbsolutePath() );
 
-        if ( originalFile != null )
-        {
-            cli.createArg().setFile( originalFile );
-
-            if ( destFile != null )
-            {
-                cli.createArg().setValue( "-o" );
-                cli.createArg().setFile( destFile );
-            }
-
-            cli.createArg().setFile( patchFile );
-        }
-
         cli.createArg().setValue( "-p" + strip );
 
         if ( ignoreWhitespace )
@@ -603,6 +591,17 @@
         cli.createArg().setValue( "-i" );
         cli.createArg().setFile( patchFile );
 
+        if ( destFile != null )
+        {
+            cli.createArg().setValue( "-o" );
+            cli.createArg().setFile( destFile );
+        }
+
+        if ( originalFile != null )
+        {
+            cli.createArg().setFile( originalFile );
+        }
+
         return cli;
     }