I'm in the process of converting a Java EE 8 library to Jakarta EE 9.1, but I'm running into conflicts between eclipselink and jakarta.jakartaee-api.
Without any exclusions defined, here is my pom. Notice eclipselink version is 4.0.0-M3, which matches the version on Payara 6 alpha. Switching eclipselink to version 3.0.3 fixes these problems.
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>4.0.0-M3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.0.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>3.0.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.26</version>
</dependency>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
module-info.java:
module com.mydomain.base {
requires com.google.common;
requires com.google.gson;
requires eclipselink;
requires jakarta.jakartaee.api;
requires java.logging;
requires java.sql;
requires jersey.client;
requires jersey.media.multipart;
requires org.apache.pdfbox;
requires org.apache.fontbox;
}
Results:
[ERROR] the unnamed module reads package jakarta.annotation from both jakarta.annotation and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.annotation.sql from both jakarta.annotation and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.annotation.security from both jakarta.annotation and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.activation from both jakarta.activation and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.ws.rs from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.ws.rs.client from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.ws.rs.sse from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.ws.rs.ext from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.ws.rs.core from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.ws.rs.container from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.persistence from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.persistence.spi from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.persistence.metamodel from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.persistence.criteria from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.inject from both jakarta.inject and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.xml.bind from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.xml.bind.attachment from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.xml.bind.annotation from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.xml.bind.annotation.adapters from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.xml.bind.util from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] the unnamed module reads package jakarta.xml.bind.helpers from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.annotation from both jakarta.annotation and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.annotation.sql from both jakarta.annotation and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.annotation.security from both jakarta.annotation and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.activation from both jakarta.activation and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.ws.rs from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.ws.rs.client from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.ws.rs.sse from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.ws.rs.ext from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.ws.rs.core from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.ws.rs.container from both jakarta.ws.rs and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.persistence from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.persistence.spi from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.persistence.metamodel from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.persistence.criteria from both jakarta.persistence and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.inject from both jakarta.inject and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.xml.bind from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.xml.bind.attachment from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.xml.bind.annotation from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.xml.bind.annotation.adapters from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.xml.bind.util from both jakarta.xml.bind and jakarta.jakartaee.api
[ERROR] module jakarta.jakartaee.api reads package jakarta.xml.bind.helpers from both jakarta.xml.bind and jakarta.jakartaee.api
If I add exclusions into the pom, like such:
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>4.0.0-M3</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.persistence</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.xml.bind</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.0.6</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>jakarta.annotation</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.inject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.ws.rs</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Results:
[ERROR] module not found: jakarta.xml.bind
[ERROR] module not found: jakarta.persistence
Any recommendations to get past this?