You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/09/16 15:39:34 UTC

svn commit: r1808566 - in /maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod: JModCreateMojo.java JModDescribeMojo.java JModListMojo.java

Author: khmarbaise
Date: Sat Sep 16 15:39:34 2017
New Revision: 1808566

URL: http://svn.apache.org/viewvc?rev=1808566&view=rev
Log:
o Changed moduleName into outputFileName to prevent confusions.
o Checking existence of jmod file for describe/list goal.

Modified:
    maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java
    maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModDescribeMojo.java
    maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModListMojo.java

Modified: maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java?rev=1808566&r1=1808565&r2=1808566&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java Sat Sep 16 15:39:34 2017
@@ -240,7 +240,7 @@ public class JModCreateMojo
      * This is only the name of the jmod file in the target directory.
      */
     @Parameter( defaultValue = "${project.artifactId}", required = true, readonly = true )
-    private String moduleName;
+    private String outputFileName;
 
     /**
      * Define the location of legal notices. The default location is <code>src/main/legalnotices</code>. The given man
@@ -324,7 +324,7 @@ public class JModCreateMojo
         // seemed to be not working.
         // Check why?
         File modsFolder = new File( outputDirectory, "jmods" );
-        File resultingJModFile = new File( modsFolder, moduleName + ".jmod" );
+        File resultingJModFile = new File( modsFolder, outputFileName + ".jmod" );
 
         deleteOutputIfAlreadyExists( resultingJModFile );
 

Modified: maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModDescribeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModDescribeMojo.java?rev=1808566&r1=1808565&r2=1808566&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModDescribeMojo.java (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModDescribeMojo.java Sat Sep 16 15:39:34 2017
@@ -66,13 +66,15 @@ public class JModDescribeMojo
 
         getLog().info( "Toolchain in maven-jmod-plugin: jmod [ " + jModExecutable + " ]" );
 
-        //TODO: Need to think about if we really require to have the jmod
+        // TODO: Need to think about if we really require to have the jmod
         // file being located in the target directory?
         File modsFolder = new File( outputDirectory, "jmods" );
         File resultingJModFile = new File( modsFolder, moduleName + ".jmod" );
 
-        // create the jmods folder...
-        modsFolder.mkdirs();
+        if ( !resultingJModFile.exists() || !resultingJModFile.isFile() )
+        {
+            throw new MojoFailureException( "Unable to find " + resultingJModFile.getAbsolutePath() );
+        }
 
         Commandline cmd;
         try

Modified: maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModListMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModListMojo.java?rev=1808566&r1=1808565&r2=1808566&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModListMojo.java (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/main/java/org/apache/maven/plugins/jmod/JModListMojo.java Sat Sep 16 15:39:34 2017
@@ -72,8 +72,10 @@ public class JModListMojo
         File modsFolder = new File( outputDirectory, "jmods" );
         File resultingJModFile = new File( modsFolder, moduleName + ".jmod" );
 
-        // create the jmods folder...
-        modsFolder.mkdirs();
+        if ( !resultingJModFile.exists() || !resultingJModFile.isFile() )
+        {
+            throw new MojoFailureException( "Unable to find " + resultingJModFile.getAbsolutePath() );
+        }
 
         Commandline cmd;
         try