Maven Shared Components
  1. Maven Shared Components
  2. MSHARED-166

Merging with existing MANIFEST.MF looses Class-Path element

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: maven-archiver-2.4.1
    • Fix Version/s: None
    • Component/s: maven-archiver
    • Labels:
      None
    • Number of attachments :
      3

      Description

      I'm using the maven-bundle-plugin together with the maven-jar-plugin (to create OSGi meta data). The plugin configuration is as follows (excerpt from effective POM):

      <plugin>
              <groupId>org.apache.felix</groupId>
              <artifactId>maven-bundle-plugin</artifactId>
              <version>2.1.0</version>
              <extensions>true</extensions>
              <executions>
                <execution>
                  <goals>
                    <goal>manifest</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <instructions>
                  <Export-Package>org.mindswap.*</Export-Package>
                  <Private-Package>impl.*</Private-Package>
                  <RequiredExecutionEnvironment>J2SE-1.5</RequiredExecutionEnvironment>
                </instructions>
              </configuration>
            </plugin>
            <plugin>
              <artifactId>maven-jar-plugin</artifactId>
              <version>2.3.1</version>
              <configuration>
                <archive>
                  <manifestFile>/Users/thorsten/development/on/owls-api/target/classes/META-INF/MANIFEST.MF</manifestFile>
                  <compress>true</compress>
                  <manifest>
                    <addClasspath>false</addClasspath>
                    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                  </manifest>
                </archive>
              </configuration>
            </plugin>
      
      1. MANIFEST.MF_final_with_maven-bundle-plugin
        8 kB
        Thorsten Möller
      2. MANIFEST.MF_final_without_maven-bundle-plugin
        1.0 kB
        Thorsten Möller
      3. MANIFEST.MF_maven-bundle-plugin
        7 kB
        Thorsten Möller

        Activity

        Hide
        Thorsten Möller added a comment -

        Sorry, hit the create button too soon. In the following more detailed description.

        I'm using the maven-bundle-plugin together with the maven-jar-plugin (to create OSGi meta data for the MANIFEST.MF(_maven-bundle-plugin) file). In short, the bundle plugin creates a MANIFEST.MF file containing all OSGi related meta data. This file is taken and merged by the jar plugin into the final MANIFEST.MF file (note that the documentation http://maven.apache.org/shared/maven-archiver/examples/manifestFile.html states "The content of your own manifest file will be merged with the entries generated by Maven Archiver.").

        The problem is that the "Class-Path" property gets lost although configuration of the jar plugin is set to create it, see MANIFEST.MF_final_with_maven-bundle-plugin. When the build runs without the bundle plugin (by deactivating corresponding lines in the POM) the "Class-Path" property exists, see MANIFEST.MF_final_without_maven-bundle-plugin. This makes me believing that there is a bug in either the jar or the archiver plugin.

        Show
        Thorsten Möller added a comment - Sorry, hit the create button too soon. In the following more detailed description. I'm using the maven-bundle-plugin together with the maven-jar-plugin (to create OSGi meta data for the MANIFEST.MF(_maven-bundle-plugin) file). In short, the bundle plugin creates a MANIFEST.MF file containing all OSGi related meta data. This file is taken and merged by the jar plugin into the final MANIFEST.MF file (note that the documentation http://maven.apache.org/shared/maven-archiver/examples/manifestFile.html states "The content of your own manifest file will be merged with the entries generated by Maven Archiver."). The problem is that the "Class-Path" property gets lost although configuration of the jar plugin is set to create it, see MANIFEST.MF_final_with_maven-bundle-plugin. When the build runs without the bundle plugin (by deactivating corresponding lines in the POM) the "Class-Path" property exists, see MANIFEST.MF_final_without_maven-bundle-plugin. This makes me believing that there is a bug in either the jar or the archiver plugin.
        Hide
        Thorsten Möller added a comment -

        The first two sentences might be confusing. Should be:

        I'm using the maven-bundle-plugin together with the maven-jar-plugin (to create OSGi meta data for the MANIFEST.MF file). In short, the bundle plugin creates a MANIFEST.MF(_maven-bundle-plugin) file containing all OSGi related meta data.

        Show
        Thorsten Möller added a comment - The first two sentences might be confusing. Should be: I'm using the maven-bundle-plugin together with the maven-jar-plugin (to create OSGi meta data for the MANIFEST.MF file). In short, the bundle plugin creates a MANIFEST.MF(_maven-bundle-plugin) file containing all OSGi related meta data.
        Hide
        Thorsten Möller added a comment -

        It was actually a bug in my POM. I had two plugin sections for the maven-jar-plugin.

        Sorry for the noise.

        Show
        Thorsten Möller added a comment - It was actually a bug in my POM. I had two plugin sections for the maven-jar-plugin. Sorry for the noise.

          People

          • Assignee:
            Unassigned
            Reporter:
            Thorsten Möller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: