Index: src/test/java/org/apache/maven/plugin/war/WarManifestMojoTest.java =================================================================== --- src/test/java/org/apache/maven/plugin/war/WarManifestMojoTest.java (revision 784221) +++ src/test/java/org/apache/maven/plugin/war/WarManifestMojoTest.java (working copy) @@ -139,8 +139,44 @@ assertTrue( idx >= 0 ); idx = content.indexOf( "Implementation-Vendor" ); + + assertTrue( idx >= 0 ); } + + public void testManifestWithCustomAttributes() + throws Exception + { + loadMojo( "target/test-classes/unit/manifest/manifest-with-custom-attrs/plugin-config.xml" ); + + MavenArchiveConfiguration config = (MavenArchiveConfiguration) getVariableValueFromObject( mojo, "archive" ); + + mojo.execute(); + + assertTrue( config.getManifest().isAddExtensions() ); + + File warSourceDir = (File) getVariableValueFromObject( mojo, "warSourceDirectory" ); + + File manifestDir = new File( warSourceDir, "META-INF" ); + + File manifest = new File( manifestDir, "MANIFEST.MF" ); + + assertTrue( manifest.exists() ); + + String content = FileUtils.fileRead( manifest ); + + int idx = content.indexOf( "Specification-Title" ); + + assertTrue( idx >= 0 ); + + idx = content.indexOf( "Custom-Version" ); + + assertTrue( idx >= 0); + + + } + + public void loadMojo( String pluginXml ) throws Exception { @@ -150,4 +186,5 @@ assertNotNull( mojo ); } + } Index: src/main/java/org/apache/maven/plugin/war/WarManifestMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/war/WarManifestMojo.java (revision 784221) +++ src/main/java/org/apache/maven/plugin/war/WarManifestMojo.java (working copy) @@ -74,7 +74,7 @@ PrintWriter printWriter = null; try { - Manifest mf = ma.getManifest( getProject(), getArchive().getManifest() ); + Manifest mf = ma.getManifest( getProject(), getArchive() ); printWriter = new PrintWriter( WriterFactory.newWriter( manifestFile, WriterFactory.UTF_8 ) ); mf.write( printWriter ); }