Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Manifest data to API jar #1697

Merged
merged 3 commits into from
Jul 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,39 @@
</configuration>
</plugin>

<!-- Generate the OSGi jar Manifest. -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting

[WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. @ line 290, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If version 5.1.6 is to be used (the latest) note that it needs 2 extra instructions to prevent it from creating a corrupted jar:

<instructions>
     <_noimportjava>true</_noimportjava>
     <_runee>JavaSE-11</_runee>
</instructions>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. It ran fine on my machine without that, so I was unaware of the need here. :)

<version>5.1.6</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
</manifest>
</archive>
<instructions>
<_noimportjava>true</_noimportjava>
<_runee>JavaSE-11</_runee>
<Specification-Title>Jakarta Faces</Specification-Title>
<Specification-Version>4.0</Specification-Version>
<!-- Set the package version to match the spec version -->
<Export-Package>
jakarta.faces*;version=4.0
</Export-Package>
</instructions>
</configuration>
</plugin>

<!-- Clean unpacked sources jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -359,6 +392,9 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
<includes>
<include>jakarta/**</include>
<include>META-INF/LICENSE.md</include>
Expand Down