mirror of https://github.com/apache/maven.git
Now allowing custom manifest file to be set in the generated EAR file.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@234462 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a20c98aa76
commit
30804e163a
|
@ -50,7 +50,6 @@ public class EarMojo
|
|||
* The location of the manifest file to be used within the ear file.
|
||||
*
|
||||
* @parameter expression="${basedir}/src/main/application/META-INF/MANIFEST.MF"
|
||||
* @TODO handle this field
|
||||
*/
|
||||
private String manifestLocation;
|
||||
|
||||
|
@ -154,6 +153,9 @@ public class EarMojo
|
|||
MavenArchiver archiver = new MavenArchiver();
|
||||
archiver.setOutputFile( earFile );
|
||||
|
||||
// Include custom manifest if necessary
|
||||
includeCustomManifestFile();
|
||||
|
||||
archiver.getArchiver().addDirectory( getBuildDir() );
|
||||
archiver.createArchive( getProject(), archive );
|
||||
|
||||
|
@ -169,4 +171,18 @@ public class EarMojo
|
|||
{
|
||||
return new File( buildDir, uri );
|
||||
}
|
||||
|
||||
private void includeCustomManifestFile()
|
||||
{
|
||||
File customManifestFile = new File( manifestLocation );
|
||||
if ( !customManifestFile.exists() )
|
||||
{
|
||||
// Does not exist so will use default
|
||||
}
|
||||
else
|
||||
{
|
||||
getLog().info( "Including custom manifest file[" + customManifestFile + "]" );
|
||||
archive.setManifestFile( customManifestFile );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue