0

We have a corporate wide super-pom that we use. It sets up all of the mvn site reports, making sure that all of the users are using Findbugs, PMD, etc.

One of the things we want to do is add entered to our MANIFEST.MF file. The entries help us pin down a particular jar to a particular Jenkins build and Subversion revision. The manifest looks like this:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: david
Build-Jdk: 1.7.0_55

Name: Build-Information
Project-Name: tc-jsonp-filter-trunk
SVN-Revision: 23928
Build-Number: 23

Name: Module-Information
Group-ID: com.travelclick
Version: 5.1
Artifact-ID: tc-jsonp-filter

If I add the following to the local pom.xml, everything works fine:

<build>
    ...
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.1</version>
            <configuration>
                <archive>
                    <manifestSections>
                        <manifestSection>
                            <name>Build-Information</name>
                            <manifestEntries>
                                <Project-Name>${env.JOB_NAME}</Project-Name>
                                <Build-Number>${env.BUILD_NUMBER}</Build-Number>
                                <SVN-Revision>${env.SVN_REVISION}</SVN-Revision>
                            </manifestEntries>
                        </manifestSection>
                        <manifestSection>
                            <name>Module-Information</name>
                            <manifestEntries>
                                <Group-ID>${project.groupId}</Group-ID>
                                <Artifact-ID>${project.artifactId}</Artifact-ID>
                                <Version>${project.version}</Version>
                            </manifestEntries>
                        </manifestSection>
                    </manifestSections>
                </archive>
            </configuration>
        </plugin>
    </plugins>
    ....
</build>

However, if I add this to my super-pom, the MANIFEST.MF file does not contain this information.

I know the super-pom is being downloaded (I can see that), and I know that other areas are working because it does JaCoCo test coverage, and that's only found in the super-pom.

David W.
  • 105,218
  • 39
  • 216
  • 337

1 Answers1

0

Found the issue:

My first attempt was using another plugin: org.apache.felix#maven-bundle-plugin. This wasn't working, so I tried the org.apache.maven.plugins#maven-jar-plugin archive configuration. This worked locally.

I then replaced my super-pom project with this change in my Maven repo, then deleted the $HOME/.m2/repository/.../super-pom.xml from my machine and tried it. It didn't work.

What I didn't realized is that I stored that super-pom in my plugins repository and not my release repository. Thus, it downloaded the older and incorrect super_pom.

Putting the super_pom in the correct directory solved the issue.

David W.
  • 105,218
  • 39
  • 216
  • 337