MultiRelease Jars
See original GitHub issueHow can I setup moditect-maven-plugin create-runtime-image to handle multiRelease jars.
I have heard that these dependencies should be Java11 aware.
<repositories>
<repository>
<id>releases.java.net</id>
<url>http://maven.java.net/content/repositories/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>jvnet-nexus-staging</id>
<url>http://maven.java.net/content/repositories/staging/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.4.0-b180608.0325</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.4.0-b180608.0325</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-jxc</artifactId>
<version>2.4.0-b180608.0325</version>
</dependency>
</dependencies>
I am trying a simple jaxb Project to test modularisation with java11.
I get this Error: Error: jaxb-xjc-2.4.0-b180608.0325.jar is a multi-release jar file but --multi-release option is not set
I am using Apache Netbeans 9.0 rc1. JDK 10.0.1
Compiler settings:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>10</release>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version> <!-- Use newer version of ASM -->
</dependency>
</dependencies>
</plugin>
Moditect Settings:
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.Beta1</version>
<executions>
<execution>
<id>add-module-infos</id>
<phase>package</phase>
<goals>
<goal>add-module-info</goal>
</goals>
<configuration>
<jvmVersion>10</jvmVersion>
<module>
<mainClass>com.myexample.jaxbtest.MainApp</mainClass>
<moduleInfo>
<name>com.myexample.jaxbtest</name>
<exports>
*;
</exports>
</moduleInfo>
</module>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.Beta1</version>
<executions>
<execution>
<id>create-runtime-image</id>
<phase>package</phase>
<goals>
<goal>create-runtime-image</goal>
</goals>
<configuration>
<modulePath>
<path>${project.build.directory}/modules</path>
</modulePath>
<modules>
<module>com.myexample.jaxbtest</module>
</modules>
<baseJdk>version=10,vendor=oracle,platform=windows</baseJdk>
<launcher>
<name>JaxbTest</name>
<module>com.myexample.jaxbtest</module>
</launcher>
<outputDirectory>
${project.build.directory}/jlink-image
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (4 by maintainers)
Top Results From Across the Web
Multi-Release Jar Files - Baeldung
The solution in Java 9 is to leave the original class untouched and instead create a new version using the new JDK and...
Read more >Multi-release JARs - Good or bad idea? - The Gradle Blog
In a nutshell, multi-release jars allow you to package several versions of the same class, for consumption by different runtimes. For example, ...
Read more >JAR File Specification
A multi-release JAR file allows for a single JAR file to support multiple major versions of Java platform releases. For example, a multi-release...
Read more >JEP 238: Multi-Release JAR Files - OpenJDK
A multi-release JAR ("MRJAR") will contain additional directories for classes and resources specific to particular Java platform releases.
Read more >How To Use Multi-release JARs To Target Multiple Java ...
Multi -release JARs allow you to create a single JAR that contains bytecode for several Java versions with jar --version 9 (or 10,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you a lot! I have it working now (checked in).
The
jdepsExtraArgs
option is mentioned on the ModiTect GitHub page. This option is also available for thegenerate-module-info
goal.