Skip to content

Commit

Permalink
[MEAR-287] - Refactoring of logging when modifying manifest of EAR mo…
Browse files Browse the repository at this point in the history
…dules
  • Loading branch information
mabrarov committed Oct 2, 2020
1 parent 5bcdf4c commit 304c4b3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/main/java/org/apache/maven/plugins/ear/EarMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -749,19 +749,21 @@ private void changeManifestClasspath( EarModule module, File original, JavaEEVer
// Create a temporary work directory
// MEAR-167 use uri as directory to prevent merging of artifacts with the same artifactId
workDirectory = new File( new File( getTempFolder(), "temp" ), module.getUri() );
if ( workDirectory.isDirectory() || workDirectory.mkdirs() )
if ( !workDirectory.isDirectory() )
{
getLog().debug( "Created a temporary work directory: " + workDirectory.getAbsolutePath() );

// Unpack the archive to a temporary work directory
zipUnArchiver.setSourceFile( original );
zipUnArchiver.setDestDirectory( workDirectory );
zipUnArchiver.extract();
}
else
{
throw new MojoFailureException( "Failed to create directory " + workDirectory );
if ( workDirectory.mkdirs() )
{
getLog().debug( "Created a temporary work directory: " + workDirectory.getAbsolutePath() );
}
else
{
throw new MojoFailureException( "Failed to create directory " + workDirectory );
}
}
// Unpack the archive to a temporary work directory
zipUnArchiver.setSourceFile( original );
zipUnArchiver.setDestDirectory( workDirectory );
zipUnArchiver.extract();
}
else
{
Expand Down

0 comments on commit 304c4b3

Please sign in to comment.