Uploaded image for project: 'Maven WAR Plugin'
  1. Maven WAR Plugin
  2. MWAR-197

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2, 2.1-alpha-1, 2.1-alpha-2, 2.1-beta-1
    • 2.1
    • None
    • None
    • Patch

    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.

      Attachments

        1. unit_test_to_add.patch
          2 kB
          Nagesh Susarla
        2. WarManifestMojo.patch
          2 kB
          Nagesh Susarla

        Issue Links

          Activity

            People

              dennisl@apache.org Dennis Lundberg
              nageshs Nagesh Susarla
              Votes:
              4 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: