mirror of https://github.com/apache/maven.git
PR: MNG-1543
Submitted By: Edwin Punzalan Reviewed By: John Casey Applied patch, with modifications. Since the writeExportReadyPom() method is no longer used, and it's not a public API, I removed it. Interpolated paths should no longer show up in packaged POMs. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@355355 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f133d8e586
commit
f4e9b5b409
|
@ -23,11 +23,9 @@ import org.codehaus.plexus.archiver.ArchiverException;
|
|||
import org.codehaus.plexus.archiver.jar.JarArchiver;
|
||||
import org.codehaus.plexus.archiver.jar.Manifest;
|
||||
import org.codehaus.plexus.archiver.jar.ManifestException;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Iterator;
|
||||
|
@ -244,9 +242,7 @@ public class MavenArchiver
|
|||
|
||||
String artifactId = workingProject.getArtifactId();
|
||||
|
||||
File exportReadyPom = writeExportReadyPom( workingProject );
|
||||
|
||||
archiver.addFile( exportReadyPom, "META-INF/maven/" + groupId + "/" + artifactId + "/pom.xml" );
|
||||
archiver.addFile( project.getFile(), "META-INF/maven/" + groupId + "/" + artifactId + "/pom.xml" );
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -341,31 +337,4 @@ public class MavenArchiver
|
|||
pomPropertiesFile.delete();
|
||||
}
|
||||
}
|
||||
|
||||
private File writeExportReadyPom( MavenProject project )
|
||||
throws IOException
|
||||
{
|
||||
String buildDirectory = project.getBuild().getDirectory();
|
||||
|
||||
File buildDirectoryFile = new File( buildDirectory );
|
||||
|
||||
buildDirectoryFile.mkdirs();
|
||||
|
||||
File fullPom = new File( buildDirectoryFile, "exported-pom.xml" );
|
||||
|
||||
FileWriter fWriter = null;
|
||||
|
||||
try
|
||||
{
|
||||
fWriter = new FileWriter( fullPom );
|
||||
|
||||
project.writeModel( fWriter );
|
||||
}
|
||||
finally
|
||||
{
|
||||
IOUtil.close( fWriter );
|
||||
}
|
||||
|
||||
return fullPom;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue