Skip to content

Commit bca4aa7

Browse files
committed
Upgrade to Quarkus 3.0
the main change is migrating from JavaEE to JakartaEE. - update Quarkus bom from io.quarkus:quarkus-universe-bom to io.quarkus.platform:quarkus-bom as it was deprecated since Quarkus 2.1 https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.1#quarkus-universe-bom-is-deprecated (and it is required to use the Quarkus migration tool) - launched quarkus `quarkus update --stream=3.0` as mentioned in https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.0#automatic-update-tool which dealt with a fair part of the migration. Then it remained few little tasks. - Updated quarkus.index-dependency for jaxb from org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec to `jakarta.xml.bind:jakarta.xml.bind-api` fix #333 current test failure: ``` [ERROR] org.lfenergy.compas.cim.mapping.rest.v1.CompasCimMappingResourceTest.mapCimToScl_WhenCalled_ThenCorrectMessageIsRetrieved Time elapsed: 1.465 s <<< FAILURE! org.opentest4j.AssertionFailedError: expected: not <null> at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152) at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49) at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35) at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:30) at org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:301) at org.lfenergy.compas.cim.mapping.rest.v1.CompasCimMappingResourceTest.mapCimToScl_WhenCalled_ThenCorrectMessageIsRetrieved(CompasCimMappingResourceTest.java:70) ``` suspect logs: ``` 2023-05-26 16:28:42,577 WARN [io.qua.dep.ste.ReflectiveHierarchyStep] (build-26) Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index: - javax.xml.bind.JAXBElement (source: SmallRyeOpenApiProcessor > org.lfenergy.compas.cim.mapping.rest.v1.model.MapResponse) - javax.xml.namespace.QName (source: SmallRyeOpenApiProcessor > org.lfenergy.compas.cim.mapping.rest.v1.model.MapResponse) Consider adding them to the index either by creating a Jandex index for your dependency via the Maven plugin, an empty META-INF/beans.xml or quarkus.index-dependency properties. 2023-05-26 16:28:42,895 WARN [io.qua.arc.pro.BeanArchives] (build-20) Failed to index javax.xml.bind.JAXBElement: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: TEST@4c579b5b ``` even if before migration there is similar (but not exactly the same) warning: ``` [WARNING] [io.quarkus.deployment.steps.ReflectiveHierarchyStep] Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index: - javax.xml.namespace.QName (source: SmallRyeOpenApiProcessor > org.lfenergy.compas.cim.mapping.rest.v1.model.MapResponse) Consider adding them to the index either by creating a Jandex index for your dependency via the Maven plugin, an empty META-INF/beans.xml or quarkus.index-dependency properties. ``` Signed-off-by: Aurélien Pupier <apupier@redhat.com>
1 parent a078aa8 commit bca4aa7

File tree

16 files changed

+44
-44
lines changed

16 files changed

+44
-44
lines changed

app/src/main/java/org/lfenergy/compas/cim/mapping/rest/CompasCimMappingConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import io.quarkus.runtime.annotations.RegisterForReflection;
77
import org.lfenergy.compas.cim.mapping.mapper.CimToSclMapper;
88

9-
import javax.enterprise.inject.Produces;
9+
import jakarta.enterprise.inject.Produces;
1010

1111
/**
1212
* Create Beans from other dependencies that are used in the application.

app/src/main/java/org/lfenergy/compas/cim/mapping/rest/monitoring/LivenessHealthCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.eclipse.microprofile.health.HealthCheckResponse;
88
import org.eclipse.microprofile.health.Liveness;
99

10-
import javax.enterprise.context.ApplicationScoped;
10+
import jakarta.enterprise.context.ApplicationScoped;
1111

1212
@Liveness
1313
@ApplicationScoped

app/src/main/java/org/lfenergy/compas/cim/mapping/rest/monitoring/ReadinessHealthCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.eclipse.microprofile.health.HealthCheckResponse;
88
import org.eclipse.microprofile.health.Readiness;
99

10-
import javax.enterprise.context.ApplicationScoped;
10+
import jakarta.enterprise.context.ApplicationScoped;
1111

1212
@Readiness
1313
@ApplicationScoped

app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/CompasCimMappingResource.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
import org.lfenergy.compas.cim.mapping.rest.v1.model.MapResponse;
1313
import org.lfenergy.compas.cim.mapping.service.CompasCimMappingService;
1414

15-
import javax.enterprise.context.RequestScoped;
16-
import javax.inject.Inject;
17-
import javax.validation.Valid;
18-
import javax.ws.rs.Consumes;
19-
import javax.ws.rs.POST;
20-
import javax.ws.rs.Path;
21-
import javax.ws.rs.Produces;
22-
import javax.ws.rs.core.MediaType;
15+
import jakarta.enterprise.context.RequestScoped;
16+
import jakarta.inject.Inject;
17+
import jakarta.validation.Valid;
18+
import jakarta.ws.rs.Consumes;
19+
import jakarta.ws.rs.POST;
20+
import jakarta.ws.rs.Path;
21+
import jakarta.ws.rs.Produces;
22+
import jakarta.ws.rs.core.MediaType;
2323

2424
@Authenticated
2525
@RequestScoped

app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/model/MapRequest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import org.eclipse.microprofile.openapi.annotations.media.Schema;
88
import org.lfenergy.compas.cim.mapping.model.CimData;
99

10-
import javax.validation.Valid;
11-
import javax.xml.bind.annotation.XmlAccessType;
12-
import javax.xml.bind.annotation.XmlAccessorType;
13-
import javax.xml.bind.annotation.XmlElement;
14-
import javax.xml.bind.annotation.XmlRootElement;
10+
import jakarta.validation.Valid;
11+
import jakarta.xml.bind.annotation.XmlAccessType;
12+
import jakarta.xml.bind.annotation.XmlAccessorType;
13+
import jakarta.xml.bind.annotation.XmlElement;
14+
import jakarta.xml.bind.annotation.XmlRootElement;
1515
import java.util.List;
1616

1717
import static org.lfenergy.compas.cim.mapping.CimMappingConstants.CIM_MAPPING_SERVICE_V1_NS_URI;

app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/model/MapResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import org.eclipse.microprofile.openapi.annotations.media.Schema;
77
import org.lfenergy.compas.scl2007b4.model.SCL;
88

9-
import javax.xml.bind.annotation.XmlAccessType;
10-
import javax.xml.bind.annotation.XmlAccessorType;
11-
import javax.xml.bind.annotation.XmlElement;
12-
import javax.xml.bind.annotation.XmlRootElement;
9+
import jakarta.xml.bind.annotation.XmlAccessType;
10+
import jakarta.xml.bind.annotation.XmlAccessorType;
11+
import jakarta.xml.bind.annotation.XmlElement;
12+
import jakarta.xml.bind.annotation.XmlRootElement;
1313

1414
import static org.lfenergy.compas.cim.mapping.CimMappingConstants.CIM_MAPPING_SERVICE_V1_NS_URI;
1515
import static org.lfenergy.compas.cim.mapping.CimMappingConstants.SCL_NS_URI;

app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/model/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
)
99
package org.lfenergy.compas.cim.mapping.rest.v1.model;
1010

11-
import javax.xml.bind.annotation.XmlNs;
12-
import javax.xml.bind.annotation.XmlSchema;
11+
import jakarta.xml.bind.annotation.XmlNs;
12+
import jakarta.xml.bind.annotation.XmlSchema;
1313

1414
import static org.lfenergy.compas.cim.mapping.CimMappingConstants.CIM_MAPPING_SERVICE_V1_NS_URI;

app/src/main/resources/application.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ quarkus.index-dependency.rest-commons.artifact-id = rest-commons
1818
quarkus.index-dependency.scl2007b4.group-id = org.lfenergy.compas.core
1919
quarkus.index-dependency.scl2007b4.artifact-id = scl2007b4
2020

21-
quarkus.index-dependency.jaxb-api.group-id = org.jboss.spec.javax.xml.bind
22-
quarkus.index-dependency.jaxb-api.artifact-id = jboss-jaxb-api_2.3_spec
21+
quarkus.index-dependency.jaxb-api.group-id = jakarta.xml.bind
22+
quarkus.index-dependency.jaxb-api.artifact-id = jakarta.xml.bind-api
2323

2424
# Settings needed for native compilation of the project.
2525
quarkus.native.resources.includes=**/com.powsybl.triplestore.api.TripleStoreFactoryService,CIM*.sparql

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ SPDX-License-Identifier: Apache-2.0
2525

2626
<compas.core.version>0.11.0</compas.core.version>
2727

28-
<quarkus.platform.version>2.16.6.Final</quarkus.platform.version>
28+
<quarkus.platform.version>3.0.4.Final</quarkus.platform.version>
2929
<microprofile-openapi-api.version>3.1</microprofile-openapi-api.version>
3030
<powsybl.version>5.1.1</powsybl.version>
3131
<log4j2.version>2.20.0</log4j2.version>
@@ -57,8 +57,8 @@ SPDX-License-Identifier: Apache-2.0
5757
<dependencyManagement>
5858
<dependencies>
5959
<dependency>
60-
<groupId>io.quarkus</groupId>
61-
<artifactId>quarkus-universe-bom</artifactId>
60+
<groupId>io.quarkus.platform</groupId>
61+
<artifactId>quarkus-bom</artifactId>
6262
<version>${quarkus.platform.version}</version>
6363
<type>pom</type>
6464
<scope>import</scope>

service/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ SPDX-License-Identifier: Apache-2.0
8888
<artifactId>hibernate-validator</artifactId>
8989
<scope>test</scope>
9090
</dependency>
91-
<dependency>
92-
<groupId>org.glassfish</groupId>
93-
<artifactId>jakarta.el</artifactId>
91+
<!--~~(No version provided)~~>--><dependency>
92+
<groupId>org.glassfish.expressly</groupId>
93+
<artifactId>expressly</artifactId>
9494
<scope>test</scope>
9595
</dependency>
9696
</dependencies>

0 commit comments

Comments
 (0)