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 2008/01/01 22:14:50 UTC

svn commit: r607916 - in /maven/plugins/trunk/maven-jar-plugin/src/it: MJAR-70-no-recreation/verify.bsh MJAR-70-recreation/verify.bsh

Author: olamy
Date: Tue Jan  1 13:14:50 2008
New Revision: 607916

URL: http://svn.apache.org/viewvc?rev=607916&view=rev
Log:
test command line return code for its which invoke mvn twice

Modified:
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-no-recreation/verify.bsh
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-recreation/verify.bsh

Modified: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-no-recreation/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-no-recreation/verify.bsh?rev=607916&r1=607915&r2=607916&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-no-recreation/verify.bsh (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-no-recreation/verify.bsh Tue Jan  1 13:14:50 2008
@@ -43,17 +43,21 @@
     }   
     
     long lastModified = artifact.lastModified();
-    
+    String localRepoPath = basedir.getParentFile().getParentFile().getParentFile().getPath() + "/target/local-repo";
     Commandline commandline = new Commandline();
     commandline.setExecutable( "mvn" );
     commandline.setWorkingDirectory( basedir );
-    commandline.createArg().setLine( "-f interpolated-pom.xml package" );     
+    commandline.createArg().setLine( "-f interpolated-pom.xml -Dmaven.repo.local=" + localRepoPath + "  package" );     
     CommandLineUtils.StringStreamConsumer consumer = new CommandLineUtils.StringStreamConsumer();
-    CommandLineUtils.executeCommandLine( commandline, consumer, consumer );
-    
+    int res = CommandLineUtils.executeCommandLine( commandline, consumer, consumer );
     System.out.println( consumer.getOutput() );
-	artifact = new File ( target, "MJAR-70-no-recreation-1.0-SNAPSHOT.jar" );     
-	if ( !artifact.exists() || artifact.isDirectory() )
+    if ( res != 0 )
+    {
+        System.err.println( "mvn cli invocation not return 0 but " + res );
+        return false;
+    }
+    artifact = new File ( target, "MJAR-70-no-recreation-1.0-SNAPSHOT.jar" );     
+    if ( !artifact.exists() || artifact.isDirectory() )
     {
         System.err.println( "artifact file is missing or a directory." );
         return false;

Modified: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-recreation/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-recreation/verify.bsh?rev=607916&r1=607915&r2=607916&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-recreation/verify.bsh (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-70-recreation/verify.bsh Tue Jan  1 13:14:50 2008
@@ -44,17 +44,19 @@
     
     long lastModified = artifact.lastModified();
     String localRepoPath = basedir.getParentFile().getParentFile().getParentFile().getPath() + "/target/local-repo";
-    System.out.println ( localRepoPath );
     Commandline commandline = new Commandline();
     commandline.setExecutable( "mvn" );
     commandline.setWorkingDirectory( basedir );
     commandline.createArg().setLine( "-f interpolated-pom.xml -Dmaven.repo.local=" + localRepoPath + " package" );     
     CommandLineUtils.StringStreamConsumer consumer = new CommandLineUtils.StringStreamConsumer();
-    CommandLineUtils.executeCommandLine( commandline, consumer, consumer );
-    
-    System.out.println( consumer.getOutput() );
-	artifact = new File ( target, "MJAR-70-recreation-1.0-SNAPSHOT.jar" );     
-	if ( !artifact.exists() || artifact.isDirectory() )
+    int res = CommandLineUtils.executeCommandLine( commandline, consumer, consumer );
+    if ( res != 0 )
+    {
+        System.err.println( "mvn cli invocation not return 0 but " + res );
+        return false;
+    }
+    artifact = new File ( target, "MJAR-70-recreation-1.0-SNAPSHOT.jar" );     
+    if ( !artifact.exists() || artifact.isDirectory() )
     {
         System.err.println( "artifact file is missing or a directory." );
         return false;