diff --git a/src/it/MINSTALL-52/verify.groovy b/src/it/MINSTALL-52/verify.groovy index 21f7323..617b5ae 100644 --- a/src/it/MINSTALL-52/verify.groovy +++ b/src/it/MINSTALL-52/verify.groovy @@ -22,4 +22,5 @@ assert new File( basedir, "../../local-repo/org/apache/maven/plugins/install/its File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() -assert buildLog.text.contains( "[DEBUG] Using META-INF/maven/org.apache.maven.plugins.install.its/minstall52/pom.xml as pomFile" ) +assert buildLog.text.contains( "[DEBUG] Loading META-INF/maven/org.apache.maven.plugins.install.its/minstall52/pom.xml" ) +assert buildLog.text.contains( "[DEBUG] Using JAR embedded POM as pomFile" ) diff --git a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java index aab859f..a006dac 100644 --- a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java +++ b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java @@ -206,7 +206,11 @@ public void execute() else { temporaryPom = readingPomFromJarFile(); - pomFile = temporaryPom; + if ( !Boolean.TRUE.equals( generatePom ) ) + { + pomFile = temporaryPom; + getLog().debug( "Using JAR embedded POM as pomFile" ); + } } if ( groupId == null || artifactId == null || version == null || packaging == null ) @@ -322,7 +326,7 @@ private File readingPomFromJarFile() if ( pomEntry.matcher( entry.getName() ).matches() ) { - getLog().debug( "Using " + entry.getName() + " as pomFile" ); + getLog().debug( "Loading " + entry.getName() ); InputStream pomInputStream = null; OutputStream pomOutputStream = null; diff --git a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java index c135d95..7efd90c 100644 --- a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java @@ -92,9 +92,6 @@ public void testBasicInstallFile() assignValuesForParameter( mojo ); mojo.execute(); - - File pomFile = (File) getVariableValueFromObject( mojo, "pomFile" ); - org.codehaus.plexus.util.FileUtils.forceDelete( pomFile ); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + packaging ); @@ -122,9 +119,6 @@ public void testInstallFileWithClassifier() mojo.execute(); - File pomFile = (File) getVariableValueFromObject( mojo, "pomFile" ); - org.codehaus.plexus.util.FileUtils.forceDelete( pomFile ); - File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "-" + classifier + "." + packaging );