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

Split package between jaxb-impl and jaxb-core prevents usage as JPMS module #1168

Closed
Tomas-Kraus opened this issue Mar 1, 2018 · 8 comments

Comments

@Tomas-Kraus
Copy link
Member

Hi, as Java 11 doesn't come with the java.xml.bind module any longer, I tried to add the JAXB RI as JPMS modules to my application. This failed though due to split packages between the following two artifacts:

<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.3.0</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>2.3.0</version>
</dependency>

If these are not the correct artifacts to use, which ones should I be using instead? Dmitry was hinting on Twitter that the split package issue supposedly is resolved, so I might just be using wrong artifacts. Note I also tried

<dependency>
   <groupId>org.glassfish.jaxb</groupId>
   <artifactId>jaxb-runtime</artifactId>
   <version>2.3.0</version>
</dependency>

But this in turn pulled in core which again resulted in split package issues. Unfortunately, the user guide at https://javaee.github.io/jaxb-v2/doc/user-guide/ch03.html#deployment also doesn't provide instructions on how to use the JAXB RI as JPMS modules.

@bravehorsie, Dmitry was mentioning that you migt have the answer. Thanks for any help :)

@Tomas-Kraus
Copy link
Member Author

@bravehorsie Commented
Hi @gunnarmorling
in 2.3.0 release only jaxb-api is capable to be run as JPMS module. If you like to test RI, you have to build master or even better https://github.com/javaee/jaxb-v2/tree/update-mr-jar-build branch.

jaxb-impl and jaxb-core were merged in master, so split package problem no longer exists.

@Tomas-Kraus
Copy link
Member Author

@bravehorsie Commented
Here is a project which should prove most basic scenarios working on JPMS after jaxb is built from sources:
https://github.com/bravehorsie/metro-jpms-test

@Tomas-Kraus
Copy link
Member Author

@bravehorsie Commented
For 2.3.0 its this part of documentation:
https://javaee.github.io/jaxb-v2/doc/user-guide/ch03.html#running-on-java-9

@Tomas-Kraus
Copy link
Member Author

@gunnarmorling Commented
Hey @bravehorsie, is there any update on this one? I'd like to test some things on JDK 11, but the issue here is a blocker for that, as JAXB has been removed from the JDK but with the current released version (2.3.0) there doesn't seem to be a way to add the JAXB JARs as modules. And mixing module path and classpath is a pain with Maven, which will use either one of them but not both.

@Tomas-Kraus
Copy link
Member Author

@bravehorsie Commented
Hi @gunnarmorling

Please try 2.4.0-b180608.0325 - this is JPMS modularized RI working on JDKs with java.xml.bind module (9,10) and those without it (11-ea).

Either these artifacts in you maven project:

    <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>

       <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>

or download this binary distribution - https://maven.java.net/content/repositories/promoted/com/sun/xml/bind/jaxb-ri/2.4.0-b180608.0325/jaxb-ri-2.4.0-b180608.0325.zip

@Tomas-Kraus
Copy link
Member Author

@bravehorsie Commented
New beta released: 2.4.0-b180725.0644

@Tomas-Kraus
Copy link
Member Author

@bravehorsie
Copy link
Contributor

Fiexed in 2.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants