mirror of https://github.com/apache/maven.git
PR: MNG-1650
Submitted By: Allan Ramirez Reviewed By: John Casey Applied patch, with modifications. First, refactored to avoid the use of a member variable for turning POM inclusion on/off. Second, please remember to follow the code formatting rules for Maven, available on the project website. This patch provides a new method for createArchive(..) which includes a flag for turning off POM inclusion from the resulting archive. The default mode used by the original createArchive(..) method is still to include POM information. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@351476 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3230df32bf
commit
b0b047eff9
|
@ -215,6 +215,13 @@ public class MavenArchiver
|
|||
|
||||
public void createArchive( MavenProject project, MavenArchiveConfiguration archiveConfiguration )
|
||||
throws ArchiverException, ManifestException, IOException, DependencyResolutionRequiredException
|
||||
{
|
||||
createArchive( project, archiveConfiguration, false );
|
||||
}
|
||||
|
||||
public void createArchive( MavenProject project, MavenArchiveConfiguration archiveConfiguration,
|
||||
boolean excludePomFiles )
|
||||
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...
|
||||
|
@ -246,7 +253,11 @@ public class MavenArchiver
|
|||
|
||||
File exportReadyPom = writeExportReadyPom( workingProject );
|
||||
|
||||
if( !excludePomFiles )
|
||||
{
|
||||
archiver.addFile( exportReadyPom, "META-INF/maven/" + groupId + "/" + artifactId + "/pom.xml" );
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Create pom.properties file
|
||||
|
@ -266,8 +277,11 @@ public class MavenArchiver
|
|||
|
||||
os.close(); // stream is flushed but not closed by Properties.store()
|
||||
|
||||
if( !excludePomFiles )
|
||||
{
|
||||
archiver.addFile( pomPropertiesFile, "META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties" );
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Create the manifest
|
||||
|
|
Loading…
Reference in New Issue