Skip to content

Commit 8c0ed76

Browse files
author
Dennis Labordus
authored
Merge pull request #160 from com-pas/develop
New release
2 parents 8510767 + 295d51c commit 8c0ed76

File tree

9 files changed

+87
-32
lines changed

9 files changed

+87
-32
lines changed

app/pom.xml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SPDX-License-Identifier: Apache-2.0
3939
</dependency>
4040
<dependency>
4141
<groupId>org.lfenergy.compas.core</groupId>
42-
<artifactId>jaxrs-commons</artifactId>
42+
<artifactId>rest-commons</artifactId>
4343
</dependency>
4444

4545
<dependency>
@@ -52,27 +52,34 @@ SPDX-License-Identifier: Apache-2.0
5252
</dependency>
5353
<dependency>
5454
<groupId>io.quarkus</groupId>
55-
<artifactId>quarkus-smallrye-jwt</artifactId>
55+
<artifactId>quarkus-resteasy-jaxb</artifactId>
5656
</dependency>
5757
<dependency>
5858
<groupId>io.quarkus</groupId>
59-
<artifactId>quarkus-smallrye-openapi</artifactId>
59+
<artifactId>quarkus-hibernate-validator</artifactId>
6060
</dependency>
61+
6162
<dependency>
6263
<groupId>io.quarkus</groupId>
63-
<artifactId>quarkus-smallrye-health</artifactId>
64+
<artifactId>quarkus-smallrye-jwt</artifactId>
6465
</dependency>
6566
<dependency>
6667
<groupId>io.quarkus</groupId>
67-
<artifactId>quarkus-resteasy-jaxb</artifactId>
68+
<artifactId>quarkus-smallrye-openapi</artifactId>
6869
</dependency>
6970
<dependency>
7071
<groupId>io.quarkus</groupId>
71-
<artifactId>quarkus-container-image-docker</artifactId>
72+
<artifactId>quarkus-smallrye-health</artifactId>
73+
</dependency>
74+
75+
<dependency>
76+
<groupId>org.jboss.logmanager</groupId>
77+
<artifactId>log4j2-jboss-logmanager</artifactId>
7278
</dependency>
79+
7380
<dependency>
7481
<groupId>io.quarkus</groupId>
75-
<artifactId>quarkus-hibernate-validator</artifactId>
82+
<artifactId>quarkus-container-image-docker</artifactId>
7683
</dependency>
7784

7885
<!-- Test Dependencies -->

app/src/main/docker/Dockerfile.jvm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/app-jvm
2222
#
2323
###
24-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7
24+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-923
2525

2626
ARG JAVA_PACKAGE=java-17-openjdk-headless
2727
ARG RUN_JAVA_VERSION=1.3.8

app/src/main/docker/Dockerfile.native

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# docker run -i --rm -p 8080:8080 quarkus/app
1515
#
1616
###
17-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7
17+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-923
1818
WORKDIR /work/
1919
RUN chown 1001 /work \
2020
&& chmod "g+rwX" /work \

app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/CompasSclAutoAlignmentConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
*/
1515
@RegisterForReflection(targets = {com.powsybl.sld.library.Components.class,
1616
com.powsybl.sld.library.Component.class,
17-
org.lfenergy.compas.core.jaxrs.model.ErrorResponse.class,
18-
org.lfenergy.compas.core.jaxrs.model.ErrorMessage.class})
17+
org.lfenergy.compas.core.commons.model.ErrorResponse.class,
18+
org.lfenergy.compas.core.commons.model.ErrorMessage.class})
1919
public class CompasSclAutoAlignmentConfiguration {
2020
@Produces
2121
@ApplicationScoped

app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/v1/SclAutoAlignmentResource.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
package org.lfenergy.compas.scl.auto.alignment.rest.v1;
55

66
import io.quarkus.security.Authenticated;
7+
import org.apache.logging.log4j.LogManager;
8+
import org.apache.logging.log4j.Logger;
79
import org.eclipse.microprofile.jwt.JsonWebToken;
810
import org.lfenergy.compas.scl.auto.alignment.rest.UserInfoProperties;
911
import org.lfenergy.compas.scl.auto.alignment.rest.v1.model.SclAutoAlignRequest;
1012
import org.lfenergy.compas.scl.auto.alignment.rest.v1.model.SclAutoAlignResponse;
1113
import org.lfenergy.compas.scl.auto.alignment.rest.v1.model.SclAutoAlignSVGRequest;
1214
import org.lfenergy.compas.scl.auto.alignment.service.SclAutoAlignmentService;
13-
import org.slf4j.Logger;
14-
import org.slf4j.LoggerFactory;
1515

1616
import javax.enterprise.context.RequestScoped;
1717
import javax.inject.Inject;
@@ -26,7 +26,7 @@
2626
@RequestScoped
2727
@Path("/auto/alignment/v1")
2828
public class SclAutoAlignmentResource {
29-
private static final Logger LOGGER = LoggerFactory.getLogger(SclAutoAlignmentResource.class);
29+
private static final Logger LOGGER = LogManager.getLogger(SclAutoAlignmentResource.class);
3030

3131
private final SclAutoAlignmentService sclAutoAlignmentService;
3232

@@ -45,6 +45,8 @@ public SclAutoAlignmentResource(SclAutoAlignmentService compasCimMappingService)
4545
@Consumes(MediaType.APPLICATION_XML)
4646
@Produces(MediaType.APPLICATION_XML)
4747
public SclAutoAlignResponse alignment(@Valid SclAutoAlignRequest request) {
48+
LOGGER.info("Auto align SCL for Substation(s) {}.", request.getSubstationNames());
49+
4850
String who = jsonWebToken.getClaim(userInfoProperties.who());
4951
LOGGER.trace("Username used for Who {}", who);
5052

@@ -58,6 +60,7 @@ public SclAutoAlignResponse alignment(@Valid SclAutoAlignRequest request) {
5860
@Produces(MediaType.APPLICATION_SVG_XML)
5961
@Path("/svg")
6062
public String svg(@Valid SclAutoAlignSVGRequest request) {
63+
LOGGER.info("Creating SVG for Substation {}.", request.getSubstationName());
6164
return sclAutoAlignmentService.getSVG(request.getSclData(), request.getSubstationName());
6265
}
6366
}

app/src/main/resources/application.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ quarkus.log.category."org.lfenergy.compas.scl.auto.alignment".level = INFO
1515
quarkus.index-dependency.compas-commons.group-id = org.lfenergy.compas.core
1616
quarkus.index-dependency.compas-commons.artifact-id = commons
1717

18-
quarkus.index-dependency.jaxrs-commons.group-id = org.lfenergy.compas.core
19-
quarkus.index-dependency.jaxrs-commons.artifact-id = jaxrs-commons
18+
quarkus.index-dependency.rest-commons.group-id = org.lfenergy.compas.core
19+
quarkus.index-dependency.rest-commons.artifact-id = rest-commons
2020

2121
quarkus.index-dependency.jaxb-api.group-id = org.jboss.spec.javax.xml.bind
2222
quarkus.index-dependency.jaxb-api.artifact-id = jboss-jaxb-api_2.3_spec
@@ -32,6 +32,7 @@ quarkus.native.resources.includes=ConvergenceLibrary/*.*,*.css
3232
%dev.quarkus.http.cors = true
3333

3434
%dev.quarkus.log.level = DEBUG
35+
%dev.quarkus.log.category."com.powsybl".level = INFO
3536
%dev.quarkus.log.category."org.lfenergy.compas.scl.auto.alignment".level = DEBUG
3637

3738
# Smallrye JWT Properties (Microprofile)

pom.xml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ SPDX-License-Identifier: Apache-2.0
2323
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
2424
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>
2525

26-
<compas.core.version>0.9.3</compas.core.version>
26+
<compas.core.version>0.11.0</compas.core.version>
2727

28-
<quarkus.platform.version>2.14.0.Final</quarkus.platform.version>
29-
<slf4j.version>2.0.3</slf4j.version>
30-
<powsybl.sld.version>2.13.1</powsybl.sld.version>
28+
<quarkus.platform.version>2.14.1.Final</quarkus.platform.version>
29+
<log4j2.version>2.19.0</log4j2.version>
30+
<powsybl.sld.version>3.0.0</powsybl.sld.version>
3131
<gson.version>2.10</gson.version>
3232
<openpojo.version>0.9.1</openpojo.version>
3333
</properties>
@@ -76,7 +76,7 @@ SPDX-License-Identifier: Apache-2.0
7676
</dependency>
7777
<dependency>
7878
<groupId>org.lfenergy.compas.core</groupId>
79-
<artifactId>jaxrs-commons</artifactId>
79+
<artifactId>rest-commons</artifactId>
8080
<version>${compas.core.version}</version>
8181
</dependency>
8282

@@ -95,13 +95,24 @@ SPDX-License-Identifier: Apache-2.0
9595
<dependency>
9696
<groupId>org.eclipse.microprofile.openapi</groupId>
9797
<artifactId>microprofile-openapi-api</artifactId>
98-
<version>3.0</version>
98+
<version>3.1</version>
9999
</dependency>
100100

101101
<dependency>
102-
<groupId>org.slf4j</groupId>
103-
<artifactId>slf4j-simple</artifactId>
104-
<version>${slf4j.version}</version>
102+
<groupId>org.apache.logging.log4j</groupId>
103+
<artifactId>log4j-api</artifactId>
104+
<version>${log4j2.version}</version>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.apache.logging.log4j</groupId>
108+
<artifactId>log4j-core</artifactId>
109+
<version>${log4j2.version}</version>
110+
</dependency>
111+
<!-- Bridge is needed for other dependency -->
112+
<dependency>
113+
<groupId>org.apache.logging.log4j</groupId>
114+
<artifactId>log4j-slf4j-impl</artifactId>
115+
<version>${log4j2.version}</version>
105116
</dependency>
106117

107118
<dependency>

service/pom.xml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,19 @@ SPDX-License-Identifier: Apache-2.0
4242
</dependency>
4343

4444
<dependency>
45-
<groupId>org.slf4j</groupId>
46-
<artifactId>slf4j-api</artifactId>
45+
<groupId>org.apache.logging.log4j</groupId>
46+
<artifactId>log4j-api</artifactId>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.apache.logging.log4j</groupId>
50+
<artifactId>log4j-core</artifactId>
51+
<scope>provided</scope>
52+
</dependency>
53+
<!-- Bridge is needed for other dependency -->
54+
<dependency>
55+
<groupId>org.apache.logging.log4j</groupId>
56+
<artifactId>log4j-slf4j-impl</artifactId>
57+
<scope>provided</scope>
4758
</dependency>
4859

4960
<!-- Test Dependencies -->
@@ -57,11 +68,6 @@ SPDX-License-Identifier: Apache-2.0
5768
<artifactId>junit-jupiter-engine</artifactId>
5869
<scope>test</scope>
5970
</dependency>
60-
<dependency>
61-
<groupId>org.slf4j</groupId>
62-
<artifactId>slf4j-simple</artifactId>
63-
<scope>test</scope>
64-
</dependency>
6571
<dependency>
6672
<groupId>com.openpojo</groupId>
6773
<artifactId>openpojo</artifactId>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
SPDX-FileCopyrightText: 2022 Alliander N.V.
4+
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<Configuration strict="true" name="TestConfiguration">
8+
<Appenders>
9+
<Appender type="Console" name="STDOUT">
10+
<Layout type="PatternLayout" pattern="%d %p %C{3.} [%t] %m%n"/>
11+
</Appender>
12+
</Appenders>
13+
14+
<Loggers>
15+
<Logger name="org.lfenergy.compas" level="debug" additivity="false">
16+
<AppenderRef ref="STDOUT"/>
17+
</Logger>
18+
19+
<Logger name="com.powsybl" level="info" additivity="false">
20+
<AppenderRef ref="STDOUT"/>
21+
</Logger>
22+
23+
<Root level="debug">
24+
<AppenderRef ref="STDOUT"/>
25+
</Root>
26+
</Loggers>
27+
</Configuration>

0 commit comments

Comments
 (0)