Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

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

Open
gunnarmorling opened this issue Mar 1, 2018 · 6 comments

Comments

@gunnarmorling
Copy link

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

@bravehorsie
Copy link
Member

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.

@bravehorsie
Copy link
Member

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

@bravehorsie
Copy link
Member

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

@gunnarmorling
Copy link
Author

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.

@bravehorsie
Copy link
Member

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

@bravehorsie
Copy link
Member

New beta released: 2.4.0-b180725.0644

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

No branches or pull requests

2 participants