update to p-u 1.4.2 and the more exacting cli code that john originally had
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@563681 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index ed73728..a59e6e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,12 +36,17 @@
<url>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-patch-plugin</url>
</scm>
+ <prerequisites>
+ <maven>2.0.6</maven>
+ </prerequisites>
+
+
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>1.1</version>
+ <version>1.4.2</version>
</dependency>
<dependency>
diff --git a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
index 9302b87..15a7d48 100644
--- a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
@@ -28,6 +28,7 @@
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.StreamConsumer;
+import org.codehaus.plexus.util.cli.shell.BourneShell;
//import org.codehaus.plexus.util.cli.shell.BourneShell;
import java.io.File;
@@ -541,8 +542,8 @@
*/
private Commandline createPatchCommand( File patchFile )
{
- Commandline cli = new Commandline();
- //cli.setShell( new BourneShell() );
+ Commandline cli = new Commandline();
+ cli.setShell( new BourneShell() );
cli.setExecutable( "patch" );
@@ -550,42 +551,34 @@
if ( originalFile != null )
{
- cli.createArgument().setLine( originalFile.getAbsolutePath() );
- //cli.createArg().setLine( originalFile.getAbsolutePath() );
+ cli.createArg().setLine( originalFile.getAbsolutePath() );
if ( destFile != null )
{
- cli.createArgument().setLine( "-o " + destFile.getAbsolutePath() );
- //cli.createArg().setLine( "-o " + destFile.getAbsolutePath() );
+ cli.createArg().setLine( "-o " + destFile.getAbsolutePath() );
}
- cli.createArgument().setValue( patchFile.getAbsolutePath() );
- //cli.createArg().setLine( patchFile.getAbsolutePath() );
+ cli.createArg().setLine( patchFile.getAbsolutePath() );
}
- cli.createArgument().setLine( "-p" + strip );
- //cli.createArg().setLine( "-p" + strip );
+ cli.createArg().setLine( "-p" + strip );
if ( ignoreWhitespace )
{
- cli.createArgument().setValue( "-l" );
- //cli.createArg().setLine( "-l" );
+ cli.createArg().setLine( "-l" );
}
if ( reverse )
{
- cli.createArgument().setValue( "-R" );
- //cli.createArg().setLine( "-R" );
+ cli.createArg().setLine( "-R" );
}
if ( backups )
{
- cli.createArgument().setValue( "-b" );
- //cli.createArg().setLine( "-b" );
+ cli.createArg().setLine( "-b" );
}
-
- cli.createArgument().setLine( "-i " + patchFile.getAbsolutePath() );
- //cli.createArg().setLine( " < " + patchFile.getAbsolutePath() );
+
+ cli.createArg().setLine( " < " + patchFile.getAbsolutePath() );
return cli;
}