Skip to content

Commit 5c43142

Browse files
author
Dennis Labordus
authored
Merge pull request #157 from com-pas/develop
New release with small fixes
2 parents 2524dd3 + a42929d commit 5c43142

File tree

10 files changed

+56
-102
lines changed

10 files changed

+56
-102
lines changed

.github/workflows/build-project.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
push:
99
branches:
1010
- '**'
11-
- '!main'
12-
- '!develop'
1311
pull_request:
1412
branches:
1513
- 'main'
@@ -40,7 +38,7 @@ jobs:
4038
restore-keys: ${{ runner.os }}-m2
4139

4240
- name: Set up JDK 1.11
43-
uses: actions/setup-java@v2.3.1
41+
uses: actions/setup-java@v2.4.0
4442
with:
4543
distribution: 'zulu'
4644
java-version: '11'
@@ -52,7 +50,7 @@ jobs:
5250
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
5351
- name: Build Native with Maven
5452
if: ${{ github.event_name == 'pull_request' }}
55-
run: ./mvnw -s custom_maven_settings.xml -B clean verify -P native
53+
run: ./mvnw -s custom_maven_settings.xml -B -P native clean verify
5654
- name: Build with Maven
5755
if: ${{ github.event_name == 'push' }}
5856
run: ./mvnw -s custom_maven_settings.xml -B clean verify

.github/workflows/release-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
4444
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
4545
- name: Set up JDK 1.11
46-
uses: actions/setup-java@v2.3.1
46+
uses: actions/setup-java@v2.4.0
4747
with:
4848
distribution: 'zulu'
4949
java-version: '11'

.github/workflows/sonarcloud-analysis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
push:
99
branches:
1010
- '**'
11-
- '!main'
12-
- '!develop'
1311
pull_request:
1412
branches:
1513
- 'main'
@@ -28,7 +26,7 @@ jobs:
2826
fetch-depth: 0
2927

3028
- name: Set up JDK 11
31-
uses: actions/setup-java@v2.3.1
29+
uses: actions/setup-java@v2.4.0
3230
with:
3331
distribution: 'zulu'
3432
java-version: '11'

app/pom.xml

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,10 @@ SPDX-License-Identifier: Apache-2.0
1818
<packaging>jar</packaging>
1919

2020
<properties>
21-
<quarkus.platform.version>2.4.2.Final</quarkus.platform.version>
22-
2321
<quarkus.container-image.group>lfenergy</quarkus.container-image.group>
2422
<quarkus.container-image.name>compas-scl-data-service</quarkus.container-image.name>
2523
</properties>
2624

27-
<dependencyManagement>
28-
<dependencies>
29-
<dependency>
30-
<groupId>io.quarkus</groupId>
31-
<artifactId>quarkus-universe-bom</artifactId>
32-
<version>${quarkus.platform.version}</version>
33-
<type>pom</type>
34-
<scope>import</scope>
35-
</dependency>
36-
</dependencies>
37-
</dependencyManagement>
38-
3925
<dependencies>
4026
<dependency>
4127
<groupId>org.lfenergy.compas.scl.data</groupId>
@@ -166,34 +152,38 @@ SPDX-License-Identifier: Apache-2.0
166152
</goals>
167153
</execution>
168154
<execution>
169-
<id>build-basex</id>
155+
<id>build-postgresql</id>
170156
<goals>
171157
<goal>build</goal>
172158
</goals>
173159
<configuration>
174160
<properties>
175-
<quarkus.profile>prod-basex</quarkus.profile>
176-
<quarkus.package.output-directory>basex-quarkus-app</quarkus.package.output-directory>
177-
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-basex.jvm</quarkus.docker.dockerfile-jvm-path>
178-
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-basex.native</quarkus.docker.dockerfile-native-path>
179-
<quarkus.container-image.tag>${project.version}-basex</quarkus.container-image.tag>
180-
<quarkus.container-image.additional-tags>latest-basex</quarkus.container-image.additional-tags>
161+
<quarkus.profile>prod-postgresql</quarkus.profile>
162+
<quarkus.package.output-directory>postgresql-quarkus-app</quarkus.package.output-directory>
163+
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-postgresql.jvm</quarkus.docker.dockerfile-jvm-path>
164+
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-postgresql.native</quarkus.docker.dockerfile-native-path>
165+
<quarkus.container-image.tag>${project.version}-postgresql</quarkus.container-image.tag>
166+
<quarkus.container-image.additional-tags>latest-postgresql</quarkus.container-image.additional-tags>
181167
</properties>
182168
</configuration>
183169
</execution>
170+
<!-- Put this build execution as last, because we will use this image to do a basic native check (NativeHealthCheckIT).
171+
This information is written in "target\quarkus-artifact.properties" and used by the integration tests (failsafe).
172+
Sadly there is only 1 file create, so this build overwrites the one from postgresql.
173+
-->
184174
<execution>
185-
<id>build-postgresql</id>
175+
<id>build-basex</id>
186176
<goals>
187177
<goal>build</goal>
188178
</goals>
189179
<configuration>
190180
<properties>
191-
<quarkus.profile>prod-postgresql</quarkus.profile>
192-
<quarkus.package.output-directory>postgresql-quarkus-app</quarkus.package.output-directory>
193-
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-postgresql.jvm</quarkus.docker.dockerfile-jvm-path>
194-
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-postgresql.native</quarkus.docker.dockerfile-native-path>
195-
<quarkus.container-image.tag>${project.version}-postgresql</quarkus.container-image.tag>
196-
<quarkus.container-image.additional-tags>latest-postgresql</quarkus.container-image.additional-tags>
181+
<quarkus.profile>prod-basex</quarkus.profile>
182+
<quarkus.package.output-directory>basex-quarkus-app</quarkus.package.output-directory>
183+
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-basex.jvm</quarkus.docker.dockerfile-jvm-path>
184+
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-basex.native</quarkus.docker.dockerfile-native-path>
185+
<quarkus.container-image.tag>${project.version}-basex</quarkus.container-image.tag>
186+
<quarkus.container-image.additional-tags>latest-basex</quarkus.container-image.additional-tags>
197187
</properties>
198188
</configuration>
199189
</execution>
@@ -219,8 +209,8 @@ SPDX-License-Identifier: Apache-2.0
219209

220210
<properties>
221211
<quarkus.package.type>native</quarkus.package.type>
222-
<!-- Allows for creating a Linux executable without GraalVM being installed -->
223-
<quarkus.native.container-build>true</quarkus.native.container-build>
212+
<quarkus.native.container-build>true</quarkus.native.container-build> <!-- Allows for creating a Linux executable without GraalVM being installed -->
213+
<quarkus.container-image.build>true</quarkus.container-image.build> <!-- Also make a Docker Image, so the native test will be executed against the container -->
224214
</properties>
225215

226216
<build>

app/src/test/java/org/lfenergy/compas/scl/data/rest/NativeHealthCheckIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
package org.lfenergy.compas.scl.data.rest;
66

7-
import io.quarkus.test.junit.NativeImageTest;
7+
import io.quarkus.test.junit.QuarkusIntegrationTest;
88

9-
@NativeImageTest
9+
@QuarkusIntegrationTest
1010
class NativeHealthCheckIT extends HealthCheckTest {
1111
// Execute the same tests but in native mode.
1212
}

doc/postgresql.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ SPDX-License-Identifier: Apache-2.0
66

77
# PostgreSQL Implementation
88

9+
## PostgreSQL Environment variables
10+
11+
Below environment variable(s) can be used to configure the connection to PostgreSQL, if PostgreSQL Server is used.
12+
13+
| Environment variable | Java Property | Description | Example |
14+
| -------------------------------- | --------------------------- | --------------------------------------------- | ---------------- |
15+
| POSTGRESQL_HOST | - | Name of the Host where PostgreSQL runs. | localhost |
16+
| POSTGRESQL_PORT | - | Port on the Host on which PostgreSQL runs. | 5432 |
17+
| POSTGRESQL_DB | - | The database used in PostgreSQL | compas |
18+
| POSTGRESQL_USERNAME | quarkus.datasource.username | Username under which the application logs in. | postgres |
19+
| POSTGRESQL_PASSWORD | quarkus.datasource.password | Password of the username used above. | postgres |
20+
21+
The variables POSTGRESQL_HOST, POSTGRESQL_PORT and POSTGRESQL_DB are used to created the JDBC URL in the property file.
22+
The value is build like 'jdbc:postgresql://${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DB}'. The variables have
23+
respectively the following defaults, 'localhost', '5432' and 'compas'.
24+
925
## Database Model
1026

1127
For the SCL Data Service the following table is automatically created using FlyWay.

pom.xml

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@ SPDX-License-Identifier: Apache-2.0
2525
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>
2626

2727
<compas.core.version>0.6.0</compas.core.version>
28-
<jakarta-bind-api.version>2.3.3</jakarta-bind-api.version>
28+
29+
<quarkus.platform.version>2.4.2.Final</quarkus.platform.version>
2930
<jaxb-impl.version>2.3.5</jaxb-impl.version>
30-
<jakarta-cdi-api.version>2.0.2</jakarta-cdi-api.version>
31-
<microprofile-config-api.version>2.0</microprofile-config-api.version>
32-
<microprofile-openapi-api.version>3.0-RC5</microprofile-openapi-api.version>
33-
<apache.commons-io.version>2.11.0</apache.commons-io.version>
34-
<flyway.version>7.15.0</flyway.version>
35-
<postgresql.version>42.3.1</postgresql.version>
31+
<microprofile-openapi-api.version>3.0</microprofile-openapi-api.version>
3632
<slf4j.version>1.7.32</slf4j.version>
37-
38-
<!-- Test -->
39-
<junit-jupiter.version>5.8.1</junit-jupiter.version>
40-
<mockito-junit-jupiter.version>4.1.0</mockito-junit-jupiter.version>
4133
<openpojo.version>0.9.1</openpojo.version>
4234
</properties>
4335

@@ -67,6 +59,14 @@ SPDX-License-Identifier: Apache-2.0
6759

6860
<dependencyManagement>
6961
<dependencies>
62+
<dependency>
63+
<groupId>io.quarkus</groupId>
64+
<artifactId>quarkus-universe-bom</artifactId>
65+
<version>${quarkus.platform.version}</version>
66+
<type>pom</type>
67+
<scope>import</scope>
68+
</dependency>
69+
7070
<dependency>
7171
<groupId>org.lfenergy.compas.scl.data</groupId>
7272
<artifactId>service</artifactId>
@@ -99,50 +99,18 @@ SPDX-License-Identifier: Apache-2.0
9999
<version>${compas.core.version}</version>
100100
</dependency>
101101

102-
<dependency>
103-
<groupId>jakarta.xml.bind</groupId>
104-
<artifactId>jakarta.xml.bind-api</artifactId>
105-
<version>${jakarta-bind-api.version}</version>
106-
</dependency>
107102
<dependency>
108103
<groupId>com.sun.xml.bind</groupId>
109104
<artifactId>jaxb-impl</artifactId>
110105
<version>${jaxb-impl.version}</version>
111106
</dependency>
112107

113-
<dependency>
114-
<groupId>jakarta.enterprise</groupId>
115-
<artifactId>jakarta.enterprise.cdi-api</artifactId>
116-
<version>${jakarta-cdi-api.version}</version>
117-
</dependency>
118-
<dependency>
119-
<groupId>org.eclipse.microprofile.config</groupId>
120-
<artifactId>microprofile-config-api</artifactId>
121-
<version>${microprofile-config-api.version}</version>
122-
</dependency>
123108
<dependency>
124109
<groupId>org.eclipse.microprofile.openapi</groupId>
125110
<artifactId>microprofile-openapi-api</artifactId>
126111
<version>${microprofile-openapi-api.version}</version>
127112
</dependency>
128113

129-
<dependency>
130-
<groupId>commons-io</groupId>
131-
<artifactId>commons-io</artifactId>
132-
<version>${apache.commons-io.version}</version>
133-
</dependency>
134-
135-
<dependency>
136-
<groupId>org.flywaydb</groupId>
137-
<artifactId>flyway-core</artifactId>
138-
<version>${flyway.version}</version>
139-
</dependency>
140-
<dependency>
141-
<groupId>org.postgresql</groupId>
142-
<artifactId>postgresql</artifactId>
143-
<version>${postgresql.version}</version>
144-
</dependency>
145-
146114
<dependency>
147115
<groupId>org.slf4j</groupId>
148116
<artifactId>slf4j-api</artifactId>
@@ -163,21 +131,6 @@ SPDX-License-Identifier: Apache-2.0
163131
<scope>test</scope>
164132
</dependency>
165133

166-
<dependency>
167-
<groupId>org.junit.jupiter</groupId>
168-
<artifactId>junit-jupiter-api</artifactId>
169-
<version>${junit-jupiter.version}</version>
170-
</dependency>
171-
<dependency>
172-
<groupId>org.junit.jupiter</groupId>
173-
<artifactId>junit-jupiter-engine</artifactId>
174-
<version>${junit-jupiter.version}</version>
175-
</dependency>
176-
<dependency>
177-
<groupId>org.mockito</groupId>
178-
<artifactId>mockito-junit-jupiter</artifactId>
179-
<version>${mockito-junit-jupiter.version}</version>
180-
</dependency>
181134
<dependency>
182135
<groupId>com.openpojo</groupId>
183136
<artifactId>openpojo</artifactId>

repository-postgresql/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ SPDX-License-Identifier: Apache-2.0
2323
<artifactId>repository</artifactId>
2424
</dependency>
2525

26-
2726
<!-- Test Dependencies -->
2827
<dependency>
2928
<groupId>org.lfenergy.compas.scl.data</groupId>

repository/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ SPDX-License-Identifier: Apache-2.0
3838
<artifactId>microprofile-openapi-api</artifactId>
3939
</dependency>
4040
<dependency>
41-
<groupId>jakarta.enterprise</groupId>
42-
<artifactId>jakarta.enterprise.cdi-api</artifactId>
41+
<groupId>jakarta.transaction</groupId>
42+
<artifactId>jakarta.transaction-api</artifactId>
4343
</dependency>
4444

4545
<dependency>

repository/src/main/java/org/lfenergy/compas/scl/data/util/SclElementProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public Element addCompasElement(Element compasPrivate, String localName, String
107107
* @return The Hitem created and added to the History Element.
108108
*/
109109
public Element addHistoryItem(Element header, String who, String fullmessage, Version version) {
110-
var formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssXXX");
110+
var formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
111111
var document = header.getOwnerDocument();
112112

113113
var history = getChildNodesByName(header, SCL_HISTORY_ELEMENT_NAME).stream().findFirst()

0 commit comments

Comments
 (0)