-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MSHADE-406] Support for Multi Release Jars (JEP-238)
- Loading branch information
1 parent
6b30767
commit ba925eb
Showing
39 changed files
with
2,172 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/it/projects/MultiReleaseJar-shade-minimize-relocate/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
invoker.java.version = 17+ | ||
invoker.goals.1=clean package | ||
invoker.goals.2=-PJava8Test validate | ||
invoker.goals.3=-PJava11Test validate | ||
invoker.goals.4=-PJava17Test validate |
287 changes: 287 additions & 0 deletions
287
src/it/projects/MultiReleaseJar-shade-minimize-relocate/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,287 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.apache.maven.its.shade.multirelease</groupId> | ||
<artifactId>shade</artifactId> | ||
<version>1.0</version> | ||
|
||
<name>MSHADE-406 Shade</name> | ||
<description> | ||
Shading multi release jar | ||
</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>nl.basjes.maven</groupId> | ||
<artifactId>multi-jdk</artifactId> | ||
<version>1.0.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<id>create-shaded-artifact</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
<mainClass>nl.example.Main</mainClass> | ||
</transformer> | ||
</transformers> | ||
<minimizeJar>true</minimizeJar> | ||
<relocations> | ||
<relocation> | ||
<pattern>nl.basjes.maven.multijdk</pattern> | ||
<shadedPattern>nl.example.shaded.multijdk</shadedPattern> | ||
</relocation> | ||
</relocations> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>Java8Test</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-toolchains-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>toolchain</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<toolchains> | ||
<jdk> | ||
<version>8</version> | ||
</jdk> | ||
</toolchains> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.1.1</version> | ||
|
||
<executions> | ||
<execution> | ||
<id>run-unshaded</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>java</executable> | ||
<arguments> | ||
<argument>-cp</argument> | ||
<argument>target/original-shade-1.0.jar:../../setup/multiReleaseJar/target/multi-jdk-1.0.0.jar</argument> | ||
<argument>nl.example.Main</argument> | ||
</arguments> | ||
<outputFile>Java8-unshaded.log</outputFile> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>run-shaded</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>java</executable> | ||
<arguments> | ||
<argument>-jar</argument> | ||
<argument>target/shade-1.0.jar</argument> | ||
</arguments> | ||
<outputFile>Java8-shaded.log</outputFile> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
|
||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
|
||
<profile> | ||
<id>Java11Test</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-toolchains-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>toolchain</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<toolchains> | ||
<jdk> | ||
<version>11</version> | ||
</jdk> | ||
</toolchains> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.1.1</version> | ||
|
||
<executions> | ||
<execution> | ||
<id>run-unshaded</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>java</executable> | ||
<arguments> | ||
<argument>-cp</argument> | ||
<argument>target/original-shade-1.0.jar:../../setup/multiReleaseJar/target/multi-jdk-1.0.0.jar</argument> | ||
<argument>nl.example.Main</argument> | ||
</arguments> | ||
<outputFile>Java11-unshaded.log</outputFile> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>run-shaded</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>java</executable> | ||
<arguments> | ||
<argument>-jar</argument> | ||
<argument>target/shade-1.0.jar</argument> | ||
</arguments> | ||
<outputFile>Java11-shaded.log</outputFile> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
|
||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
|
||
<profile> | ||
<id>Java17Test</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-toolchains-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>toolchain</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<toolchains> | ||
<jdk> | ||
<version>17</version> | ||
</jdk> | ||
</toolchains> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.1.1</version> | ||
|
||
<executions> | ||
<execution> | ||
<id>run-unshaded</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>java</executable> | ||
<arguments> | ||
<argument>-cp</argument> | ||
<argument>target/original-shade-1.0.jar:../../setup/multiReleaseJar/target/multi-jdk-1.0.0.jar</argument> | ||
<argument>nl.example.Main</argument> | ||
</arguments> | ||
<outputFile>Java17-unshaded.log</outputFile> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>run-shaded</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>java</executable> | ||
<arguments> | ||
<argument>-jar</argument> | ||
<argument>target/shade-1.0.jar</argument> | ||
</arguments> | ||
<outputFile>Java17-shaded.log</outputFile> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
|
||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
|
||
</profiles> | ||
|
||
</project> |
Oops, something went wrong.