-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MEAR-287] Fixed failure when destination directory exists #17
Conversation
@@ -443,7 +443,7 @@ 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 :) | |||
if ( !destinationFile.mkdirs() ) | |||
if ( !destinationFile.isDirectory() && !destinationFile.mkdirs() ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a test. Assuming this is an issue (I can't reproduce) there are other areas that need to be fixed too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test created in zzzLobster#1. That test covers change in line 752 but not in this line. I'll check if I can extend test. Let me know if it is not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... it wasn't so hard to extend the test. Now it covers both changed lines, i.e. it fails if one of changes is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have merged the Marat's PR, So the PR currently contains IT for it
…of previous build exist in target location
[MEAR-287] - Integration test for MEAR-287 fix
@@ -749,7 +749,7 @@ 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.mkdirs() ) | |||
if ( workDirectory.isDirectory() || workDirectory.mkdirs() ) | |||
{ | |||
getLog().debug( "Created a temporary work directory: " + workDirectory.getAbsolutePath() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log message is now incorrect here; probably need a nested if in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just simplify log message till:
getLog().debug( "Temporary work directory: " + workDirectory.getAbsolutePath() );
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging was reworked as requested in 304c4b3
/** | ||
* Builds WAR and EAR as part of multi-module project twice so that the 2nd build is guaranteed to be performed when | ||
* target directories and files exist. | ||
* @throws Exception in case of an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this @throws clause isn't needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with useless of this part of this JavaDoc but I prefer to keep code consistent - all tests in this file have this @throws
JavaDoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to be consistent with mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, do you find it appropriate if I remove this useless JavaDoc from all tests in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in eeb458b
# Conflicts: # pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's pending / required for merging this pull request? |
Trying jenkins again: https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-ear-plugin/job/17/ |
MEAR-287 Fixed failure when destination directory exists