zzzLobster commented on a change in pull request #15:
URL: https://github.com/apache/maven-ear-plugin/pull/15#discussion_r498081406



##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -453,7 +453,10 @@ private void copyModules( final JavaEEVersion 
javaEEVersion,
                 {
                     getLog().info( "Copying artifact [" + module + "] to [" + 
module.getUri() + "] (unpacked)" );
                     // Make sure that the destination is a directory to avoid 
plexus nasty stuff :)
-                    destinationFile.mkdirs();
+                    if ( !destinationFile.mkdirs() )

Review comment:
       This change seems to be causing an issue when build is run without 
"clean".
   `[INFO] Copying artifact [ejb:com.aaa.bbb:bbb-ejb:1.0.0.0-SNAPSHOT] to 
[bbb-ejb.jar]`
   `[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-ear-plugin:3.1.0:ear (default-ear) on project 
bbb-ear: Failed to create directory 
/Checkout/project/bbb/bbb-ear/target/temp/bbb-ejb.jar -> [Help 1]`
   
   Probably it should be wrapped with something like:
   ```java
   if ( !destinationFile.isDirectory() )
   {
       if ( !destinationFile.mkdirs() )
       {
           throw new MojoExecutionException( "Error creating " + 
destinationFile );
       }
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to