diff --git a/app/pom.xml b/app/pom.xml index 133494c..62a0988 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -34,7 +34,7 @@ SPDX-License-Identifier: Apache-2.0 org.lfenergy.compas.core - jaxrs-commons + rest-commons @@ -47,27 +47,34 @@ SPDX-License-Identifier: Apache-2.0 io.quarkus - quarkus-smallrye-jwt + quarkus-resteasy-jaxb io.quarkus - quarkus-smallrye-openapi + quarkus-hibernate-validator + io.quarkus - quarkus-smallrye-health + quarkus-smallrye-jwt io.quarkus - quarkus-resteasy-jaxb + quarkus-smallrye-openapi io.quarkus - quarkus-container-image-docker + quarkus-smallrye-health + + + + org.jboss.logmanager + log4j2-jboss-logmanager + io.quarkus - quarkus-hibernate-validator + quarkus-container-image-docker diff --git a/app/src/main/docker/Dockerfile.jvm b/app/src/main/docker/Dockerfile.jvm index ab847d9..ee8b2bf 100644 --- a/app/src/main/docker/Dockerfile.jvm +++ b/app/src/main/docker/Dockerfile.jvm @@ -21,7 +21,7 @@ # docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/app-jvm # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-923 ARG JAVA_PACKAGE=java-17-openjdk-headless ARG RUN_JAVA_VERSION=1.3.8 diff --git a/app/src/main/docker/Dockerfile.native b/app/src/main/docker/Dockerfile.native index 414d9f7..95c9f04 100644 --- a/app/src/main/docker/Dockerfile.native +++ b/app/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/app # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-923 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ diff --git a/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/CompasCimMappingConfiguration.java b/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/CompasCimMappingConfiguration.java index 268ee1c..ee91d30 100644 --- a/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/CompasCimMappingConfiguration.java +++ b/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/CompasCimMappingConfiguration.java @@ -13,8 +13,8 @@ */ @RegisterForReflection(targets = { com.powsybl.triplestore.impl.rdf4j.TripleStoreFactoryServiceRDF4J.class, - org.lfenergy.compas.core.jaxrs.model.ErrorResponse.class, - org.lfenergy.compas.core.jaxrs.model.ErrorMessage.class, + org.lfenergy.compas.core.commons.model.ErrorResponse.class, + org.lfenergy.compas.core.commons.model.ErrorMessage.class, javax.xml.namespace.QName.class }) public class CompasCimMappingConfiguration { diff --git a/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/CompasCimMappingResource.java b/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/CompasCimMappingResource.java index 0e3e08f..c6cc4ed 100644 --- a/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/CompasCimMappingResource.java +++ b/app/src/main/java/org/lfenergy/compas/cim/mapping/rest/v1/CompasCimMappingResource.java @@ -4,13 +4,13 @@ package org.lfenergy.compas.cim.mapping.rest.v1; import io.quarkus.security.Authenticated; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eclipse.microprofile.jwt.JsonWebToken; import org.lfenergy.compas.cim.mapping.rest.UserInfoProperties; import org.lfenergy.compas.cim.mapping.rest.v1.model.MapRequest; import org.lfenergy.compas.cim.mapping.rest.v1.model.MapResponse; import org.lfenergy.compas.cim.mapping.service.CompasCimMappingService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; @@ -25,7 +25,7 @@ @RequestScoped @Path("/cim/v1/") public class CompasCimMappingResource { - private static final Logger LOGGER = LoggerFactory.getLogger(CompasCimMappingResource.class); + private static final Logger LOGGER = LogManager.getLogger(CompasCimMappingResource.class); private CompasCimMappingService compasCimMappingService; @@ -45,6 +45,7 @@ public CompasCimMappingResource(CompasCimMappingService compasCimMappingService) @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public MapResponse map(@Valid MapRequest request) { + LOGGER.info("Converting CIM File to SCL File"); String who = jsonWebToken.getClaim(userInfoProperties.who()); LOGGER.trace("Username used for Who {}", who); diff --git a/app/src/main/resources/application.properties b/app/src/main/resources/application.properties index 22467aa..b9c8ce5 100644 --- a/app/src/main/resources/application.properties +++ b/app/src/main/resources/application.properties @@ -12,8 +12,8 @@ quarkus.log.level = INFO quarkus.log.category."org.lfenergy.compas.cim.mapping".level = INFO # Add scanning these dependencies for scanning, also used by native compilation. -quarkus.index-dependency.jaxrs-commons.group-id = org.lfenergy.compas.core -quarkus.index-dependency.jaxrs-commons.artifact-id = jaxrs-commons +quarkus.index-dependency.rest-commons.group-id = org.lfenergy.compas.core +quarkus.index-dependency.rest-commons.artifact-id = rest-commons quarkus.index-dependency.scl2007b4.group-id = org.lfenergy.compas.core quarkus.index-dependency.scl2007b4.artifact-id = scl2007b4 @@ -30,6 +30,8 @@ quarkus.native.additional-build-args=--initialize-at-run-time=org.eclipse.rdf4j. %dev.quarkus.http.cors = true %dev.quarkus.log.level = DEBUG +%dev.quarkus.log.category."com.powsybl".level = INFO +%dev.quarkus.log.category."org.eclipse.rdf4j".level = INFO %dev.quarkus.log.category."org.lfenergy.compas.cim.mapping".level = DEBUG # Smallrye JWT Properties (Microprofile) diff --git a/pom.xml b/pom.xml index 291a93c..01db9ce 100644 --- a/pom.xml +++ b/pom.xml @@ -23,12 +23,12 @@ SPDX-License-Identifier: Apache-2.0 3.0.0-M7 3.2.0 - 0.9.3 + 0.11.0 - 2.14.0.Final - 3.0 - 2.0.3 - 4.10.1 + 2.14.1.Final + 3.1 + 5.0.0 + 2.19.0 1.5.3.Final 0.9.1 @@ -77,7 +77,7 @@ SPDX-License-Identifier: Apache-2.0 org.lfenergy.compas.core - jaxrs-commons + rest-commons ${compas.core.version} @@ -105,9 +105,20 @@ SPDX-License-Identifier: Apache-2.0 - org.slf4j - slf4j-simple - ${slf4j.version} + org.apache.logging.log4j + log4j-api + ${log4j2.version} + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2.version} diff --git a/service/pom.xml b/service/pom.xml index 61708ba..d8c5ffa 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -52,8 +52,19 @@ SPDX-License-Identifier: Apache-2.0 - org.slf4j - slf4j-api + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + provided + + + + org.apache.logging.log4j + log4j-slf4j-impl + provided @@ -67,11 +78,6 @@ SPDX-License-Identifier: Apache-2.0 junit-jupiter-engine test - - org.slf4j - slf4j-simple - test - com.openpojo openpojo diff --git a/service/src/main/java/org/lfenergy/compas/cim/mapping/cgmes/CgmesCimReader.java b/service/src/main/java/org/lfenergy/compas/cim/mapping/cgmes/CgmesCimReader.java index 3f9ecec..2299ffa 100644 --- a/service/src/main/java/org/lfenergy/compas/cim/mapping/cgmes/CgmesCimReader.java +++ b/service/src/main/java/org/lfenergy/compas/cim/mapping/cgmes/CgmesCimReader.java @@ -8,10 +8,10 @@ import com.powsybl.commons.datasource.ReadOnlyMemDataSource; import com.powsybl.triplestore.api.TripleStoreFactory; import org.apache.commons.io.input.ReaderInputStream; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.lfenergy.compas.cim.mapping.exception.CompasCimMappingException; import org.lfenergy.compas.cim.mapping.model.CimData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.enterprise.context.ApplicationScoped; import java.io.InputStream; @@ -28,7 +28,7 @@ */ @ApplicationScoped public class CgmesCimReader { - private static final Logger LOGGER = LoggerFactory.getLogger(CgmesCimReader.class); + private static final Logger LOGGER = LogManager.getLogger(CgmesCimReader.class); /** * Use PowSyBl to convert a CIM XML InputStream to the PowSyBl Cgmes Model. diff --git a/service/src/main/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapper.java b/service/src/main/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapper.java index 8c6401f..3274a10 100644 --- a/service/src/main/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapper.java +++ b/service/src/main/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapper.java @@ -3,12 +3,12 @@ // SPDX-License-Identifier: Apache-2.0 package org.lfenergy.compas.cim.mapping.mapper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.lfenergy.compas.cim.mapping.model.*; import org.lfenergy.compas.scl2007b4.model.*; import org.mapstruct.*; import org.mapstruct.factory.Mappers; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.math.BigDecimal; @@ -25,7 +25,7 @@ public abstract class CimToSclMapper { public static final CimToSclMapper INSTANCE = Mappers.getMapper(CimToSclMapper.class); - private static final Logger LOGGER = LoggerFactory.getLogger(CimToSclMapper.class); + private static final Logger LOGGER = LogManager.getLogger(CimToSclMapper.class); /** * Top level mapping method to start the mapping of all known elements from Cgmes Model diff --git a/service/src/test/resources/log4j2.xml b/service/src/test/resources/log4j2.xml new file mode 100644 index 0000000..24cf918 --- /dev/null +++ b/service/src/test/resources/log4j2.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + +