Fix compile error

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@345471 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-11-18 07:54:40 +00:00
parent 23062dbf13
commit 2da90eece1
1 changed files with 10 additions and 8 deletions

View File

@ -216,6 +216,12 @@ public class MavenArchiver
public void createArchive( MavenProject project, MavenArchiveConfiguration archiveConfiguration )
throws ArchiverException, ManifestException, IOException, DependencyResolutionRequiredException
{
// we have to clone the project instance so we can write out the pom with the deployment version,
// without impacting the main project instance...
MavenProject workingProject = new MavenProject( project );
File pomPropertiesFile = new File( workingProject.getFile().getParentFile(), "pom.properties" );
if ( archiveConfiguration.isAddMavenDescriptor() )
{
// ----------------------------------------------------------------------
@ -229,10 +235,6 @@ public class MavenArchiver
// POM information without the use of maven tools can do so.
// ----------------------------------------------------------------------
// we have to clone the project instance so we can write out the pom with the deployment version,
// without impacting the main project instance...
MavenProject workingProject = new MavenProject( project );
if ( workingProject.getArtifact().isSnapshot() )
{
workingProject.setVersion( workingProject.getArtifact().getVersion() );
@ -258,8 +260,6 @@ public class MavenArchiver
p.setProperty( "version", workingProject.getVersion() );
File pomPropertiesFile = new File( workingProject.getFile().getParentFile(), "pom.properties" );
OutputStream os = new FileOutputStream( pomPropertiesFile );
p.store( os, "Generated by Maven" );
@ -335,8 +335,10 @@ public class MavenArchiver
archiver.createArchive();
// Cleanup
pomPropertiesFile.delete();
if ( archiveConfiguration.isAddMavenDescriptor() )
{
pomPropertiesFile.delete();
}
}
private File writeExportReadyPom( MavenProject project )