Maven 2.x WAR Plugin

war:manifest does not add "manifestEntries" to generated manifest

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.2, 2.1-alpha-1, 2.1-alpha-2, 2.1-beta-1
  • Fix Version/s: 2.1
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

Team: As stated in the summary, the manifest goal doesnt seem to add any of the manifestEntries to the generated manifest. Here is a testcase that I added to the project which exposes the issue

<project>
  <name>war-plugin-test</name>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <project implementation="org.apache.maven.plugin.war.stub.MavenProjectBasicStub"/>
          <warSourceDirectory>
            ${basedir}/target/test-classes/unit/manifest/manifest-with-custom-attrs/src/main</warSourceDirectory>
          <archive>
            <manifest>
              <addExtensions>true</addExtensions>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <Custom-Version>2.0</Custom-Version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Expected: "Custom-Version" is expected in the manifest. But it not present in the generated manifest

Actual:

Manifest-Version: 1.0
Created-By: Apache Maven
Built-By: nageshs
Build-Jdk: 1.6.0_07
Specification-Title: Test Project
Specification-Version: 0.0-Test
Specification-Vendor: Test Name
Implementation-Title: Test Project
Implementation-Version: 0.0-Test
Implementation-Vendor-Id: org.apache.maven.plugin.test
Implementation-Vendor: Test Name

I'm also attaching a fix along with a unit test to test the presence of the custom manifest entry.

After the fix all tests pass and the "Custom-Version" is also included in the manifest.

  1. unit_test_to_add.patch
    12/Jun/09 4:02 PM
    2 kB
    Nagesh Susarla
  2. WarManifestMojo.patch
    12/Jun/09 4:02 PM
    2 kB
    Nagesh Susarla

Activity

Hide
Dennis Lundberg added a comment -

Fixed in r984603.
Thanks for the patches!

Show
Dennis Lundberg added a comment - Fixed in r984603. Thanks for the patches!

People

Vote (4)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: