Skip to content

Commit

Permalink
[oss] use multi-release mechanism to ship jaxb (apache#2658)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoulii authored Mar 18, 2024
1 parent 0d4cbf0 commit 8ff370b
Show file tree
Hide file tree
Showing 5 changed files with 234 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class PluginLoader {
Stream.concat(
Arrays.stream(PARENT_FIRST_LOGGING_PATTERNS),
Stream.of(
"javax.xml.bind",
"org.codehaus.janino",
"org.codehaus.commons",
"org.apache.commons.lang3"))
Expand Down
73 changes: 73 additions & 0 deletions paimon-filesystems/paimon-oss-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,76 @@
<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifestEntries>
<!-- jaxb-api is packaged as an optional dependency that is only accessible on Java 11 -->
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-javax-jars</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.api.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/temporary</outputDirectory>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>unpack-javax-libraries</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="unpacking javax jars"/>
<unzip dest="${project.build.directory}/classes/META-INF/versions/11">
<fileset dir="${project.build.directory}/temporary">
<include name="*"/>
</fileset>
</unzip>
</target>
</configuration>
</execution>
</executions>
</plugin>

<!-- Relocate all OSS related classes -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -123,6 +193,9 @@
<exclude>.gitkeep</exclude>
<exclude>mime.types</exclude>
<exclude>mozilla/**</exclude>
<exclude>META-INF/maven/**</exclude>
<exclude>META-INF/versions/11/META-INF/maven/**</exclude>
<exclude>META-INF/LICENSE.txt</exclude>
</excludes>
</filter>
</filters>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,8 @@ This project bundles the following dependencies under BSD License (https://opens
You find it under licenses/LICENSE.stax2api.

- org.codehaus.woodstox:stax2-api:4.2.1 (https://github.com/FasterXML/stax2-api/tree/stax2-api-4.2.1)

This project bundles the following dependencies under the CDDL 1.1 license.
You find it under licenses/LICENSE.jaxb.

- javax.xml.bind:jaxb-api:2.3.1
Loading

0 comments on commit 8ff370b

Please sign in to comment.