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

Create manifest files separately and reference in bundle plugin, THEN shade in the new manifest for Jakarta separately before install #136

Merged
merged 3 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
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
57 changes: 53 additions & 4 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ ${project.groupId}.annotation.*;version=${project.version}
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<configuration>
Copy link
Member

Choose a reason for hiding this comment

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

I moved this to parent pom, so should not be needed here (at least seemed to work when I tried)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wasn't placing in the META-INF/vesrions folder :)

Copy link
Member

Choose a reason for hiding this comment

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

hmmh. Seemed to, for me, but I can double-check after merging.

<jvmVersion>11</jvmVersion>
</configuration>
</plugin>

<plugin>
Expand All @@ -71,6 +74,14 @@ ${project.groupId}.annotation.*;version=${project.version}
<include>${project.groupId}:${project.artifactId}</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>${project.groupId}:${project.artifactId}</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>javax.xml.bind</pattern>
Expand All @@ -91,10 +102,9 @@ ${project.groupId}.annotation.*;version=${project.version}
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="io.yupiik.maven.shade.transformer.RelocationTransformer">
<delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
</delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/MANIFEST.MF</resource>
<file>${build.directory}/jakarta/MANIFEST.MF</file>
</transformer>
</transformers>
</configuration>
Expand All @@ -109,6 +119,45 @@ ${project.groupId}.annotation.*;version=${project.version}
</dependencies>
</plugin>

<!-- Jakarta bundle fix - nb place last for execution order on package phase
@gedmarc 20210222-->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<executions>
<execution>
<id>default_bundle</id>
<phase>process-classes</phase>
<goals>
<goal>bundle</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/javax</manifestLocation>
<packaging>jar</packaging>
<instructions>
<_nouses>false</_nouses>
</instructions>
</configuration>
</execution>
<execution>
<id>bundle_jakarta_manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/jakarta</manifestLocation>
<classifier>jakarta</classifier>
<packaging>jar</packaging>
<instructions>
<Import-Package>jakarta.ws.rs;version="[3.0,4)",jakarta.ws.rs.core;version="[3.0,4)",jakarta.ws.rs.ext;version="[3.0,4)",!javax.ws*,*</Import-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
57 changes: 53 additions & 4 deletions datatypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<configuration>
<jvmVersion>11</jvmVersion>
</configuration>
</plugin>

<plugin>
Expand All @@ -96,6 +99,14 @@
<include>${project.groupId}:${project.artifactId}</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>${project.groupId}:${project.artifactId}</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>javax.xml.bind</pattern>
Expand All @@ -116,10 +127,9 @@
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="io.yupiik.maven.shade.transformer.RelocationTransformer">
<delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
</delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/MANIFEST.MF</resource>
<file>${build.directory}/jakarta/MANIFEST.MF</file>
</transformer>
</transformers>
</configuration>
Expand All @@ -134,6 +144,45 @@
</dependencies>
</plugin>

<!-- Jakarta bundle fix - nb place last for execution order on package phase
@gedmarc 20210222-->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<executions>
<execution>
<id>default_bundle</id>
<phase>process-classes</phase>
<goals>
<goal>bundle</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/javax</manifestLocation>
<packaging>jar</packaging>
<instructions>
<_nouses>false</_nouses>
</instructions>
</configuration>
</execution>
<execution>
<id>bundle_jakarta_manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/jakarta</manifestLocation>
<classifier>jakarta</classifier>
<packaging>jar</packaging>
<instructions>
<Import-Package>jakarta.ws.rs;version="[3.0,4)",jakarta.ws.rs.core;version="[3.0,4)",jakarta.ws.rs.ext;version="[3.0,4)",!javax.ws*,*</Import-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
57 changes: 53 additions & 4 deletions json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<configuration>
<jvmVersion>11</jvmVersion>
</configuration>
</plugin>

<plugin>
Expand All @@ -131,6 +134,14 @@
<include>${project.groupId}:${project.artifactId}</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>${project.groupId}:${project.artifactId}</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>javax.xml.bind</pattern>
Expand All @@ -151,10 +162,9 @@
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="io.yupiik.maven.shade.transformer.RelocationTransformer">
<delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
</delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/MANIFEST.MF</resource>
<file>${build.directory}/jakarta/MANIFEST.MF</file>
</transformer>
</transformers>
</configuration>
Expand All @@ -168,6 +178,45 @@
</dependency>
</dependencies>
</plugin>

<!-- Jakarta bundle fix - nb place last for execution order on package phase
@gedmarc 20210222-->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<executions>
<execution>
<id>default_bundle</id>
<phase>process-classes</phase>
<goals>
<goal>bundle</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/javax</manifestLocation>
<packaging>jar</packaging>
<instructions>
<_nouses>false</_nouses>
</instructions>
</configuration>
</execution>
<execution>
<id>bundle_jakarta_manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/jakarta</manifestLocation>
<classifier>jakarta</classifier>
<packaging>jar</packaging>
<instructions>
<Import-Package>jakarta.ws.rs;version="[3.0,4)",jakarta.ws.rs.core;version="[3.0,4)",jakarta.ws.rs.ext;version="[3.0,4)",!javax.ws*,*</Import-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
24 changes: 5 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<configuration>
<instructions>
<_nouses>false</_nouses>
</instructions>
</configuration>
</plugin>

<plugin>
<!-- Inherited from oss-base. Generate PackageVersion.java.-->
<groupId>com.google.code.maven-replacer-plugin</groupId>
Expand All @@ -148,33 +150,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<!-- 20-Feb-2021, tatu: For Jackson 2.x, put `module-info.class` under location
only visible to JDK 11+ (to avoid issues with older pre-Java9 frameworks?)
-->
<configuration>
<jvmVersion>11</jvmVersion>
</configuration>
</plugin>
<!-- 20-Feb-2021, tatu: As per [jaxrs-providers#132] need some more relocating... -->
<!-- TODO!!! Why is version number here not sufficient for child projects?! -->
<plugin>
<groupId>io.yupiik.maven</groupId>
<artifactId>maven-shade-transformers</artifactId>
<version>0.0.1</version>
</plugin>

</plugins>
</pluginManagement>

<!-- 05-Jul-2020, tatu: Add generation of Gradle Module Metadata -->
<plugins>
<plugin>

<plugin>
<groupId>de.jjohannes</groupId>
<artifactId>gradle-module-metadata-maven-plugin</artifactId>
</plugin>
</plugin>
</plugins>
</build>
</project>
54 changes: 50 additions & 4 deletions xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@
<include>${project.groupId}:${project.artifactId}</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>${project.groupId}:${project.artifactId}</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>javax.xml.bind</pattern>
Expand All @@ -153,10 +161,9 @@
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="io.yupiik.maven.shade.transformer.RelocationTransformer">
<delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
</delegates>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/MANIFEST.MF</resource>
<file>${build.directory}/jakarta/MANIFEST.MF</file>
</transformer>
</transformers>
</configuration>
Expand All @@ -170,6 +177,45 @@
</dependency>
</dependencies>
</plugin>

<!-- Jakarta bundle fix - nb place last for execution order on package phase
@gedmarc 20210222-->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<executions>
<execution>
<id>default_bundle</id>
<phase>process-classes</phase>
<goals>
<goal>bundle</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/javax</manifestLocation>
<packaging>jar</packaging>
<instructions>
<_nouses>false</_nouses>
</instructions>
</configuration>
</execution>
<execution>
<id>bundle_jakarta_manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<manifestLocation>${build.directory}/jakarta</manifestLocation>
<classifier>jakarta</classifier>
<packaging>jar</packaging>
<instructions>
<Import-Package>jakarta.ws.rs;version="[3.0,4)",jakarta.ws.rs.core;version="[3.0,4)",jakarta.ws.rs.ext;version="[3.0,4)",!javax.ws*,*</Import-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>