Skip to content

Commit fae552f

Browse files
committed
refactor: backport of steve-community#1822
1 parent 133ac5e commit fae552f

220 files changed

Lines changed: 1213 additions & 2099 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,20 @@ jobs:
4343
- name: Build with Maven
4444
run: |
4545
./mvnw -B -V \
46-
-Pdev,useRealDatabase \
4746
-DskipTests=false \
4847
-Dmaven.javadoc.skip=true \
49-
-Ddb.jdbc.url="jdbc:mysql://127.0.0.1:3306/${DB_SCHEMA}?sslMode=PREFERRED&serverTimezone=UTC" \
50-
-Ddb.schema="${DB_SCHEMA}" \
48+
-PuseRealDatabase \
49+
-Dspring.profiles.active=test,dev \
5150
-Ddb.user="${DB_USER}" \
5251
-Ddb.password="${DB_PASSWORD}" \
53-
-Ddb.sql.logging=true \
54-
-Dprofile=test \
55-
-Dappender=CONSOLE \
56-
clean package --file pom.xml
52+
-Ddb.schema="${DB_SCHEMA}" \
53+
-Ddb.jdbc.url="jdbc:mysql://127.0.0.1:3306/${DB_SCHEMA}?sslMode=PREFERRED&serverTimezone=UTC" \
54+
clean package
5755
5856
- name: Start the app and visit signin web page
5957
run: |
6058
sudo apt-get install -y elinks
61-
java -Djava.net.preferIPv4Stack=true -jar steve/target/steve.jar &
59+
java -Djava.net.preferIPv4Stack=true -jar steve/target/steve.war &
6260
sleep 30
6361
elinks -dump -no-references http://localhost:8080/manager/signin
6462
killall java

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ FLUSH PRIVILEGES;
6868
Note: On MySQL 8.0+, you cannot grant privileges on `INFORMATION_SCHEMA`; metadata read access is implicit. The grants above are sufficient for Flyway and jOOQ code generation.
6969

7070
**2. Application Properties:**
71-
The default configuration is in `steve/src/main/resources/config/main.properties`. You can either edit this file or provide the configuration as command-line arguments during the build.
71+
The default configuration is in `steve/src/main/resources/application.yml`. You can either edit this file or provide the configuration as command-line arguments during the build.
7272

7373
### Maven Profiles and Properties
7474

@@ -97,18 +97,18 @@ Example with overridden properties:
9797
./mvnw package -Ddb.jdbc.url=<jdbcUrl> -Ddb.schema=<schema> -Ddb.user=<username> -Ddb.password=<password>
9898
```
9999

100-
A runnable JAR file will be created at `steve/target/steve.jar`.
100+
A runnable JAR file will be created at `steve/target/steve.war`.
101101

102102
## Running the Application
103103

104104
After building, you can run the application with the following command:
105105
```bash
106-
java -jar steve/target/steve.jar
106+
java -jar steve/target/steve.war
107107
```
108108

109109
Example with overridden properties:
110110
```bash
111-
java -Ddb.jdbc.url=<jdbcUrl> -Ddb.schema=<schema> -Ddb.user=<username> -Ddb.password=<password> -jar steve/target/steve.jar
111+
java -Ddb.jdbc.url=<jdbcUrl> -Ddb.schema=<schema> -Ddb.user=<username> -Ddb.password=<password> -jar steve/target/steve.war
112112
```
113113

114114
## Running Tests

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ RUN --mount=type=cache,target=/root/.m2 \
5252
-Ddb.schema="${DB_DATABASE}" \
5353
-Ddb.user="${DB_USER}" \
5454
-Ddb.password="${DB_PASSWORD}" \
55-
-Dprofile=prod \
5655
-Dappender=CONSOLE
5756

5857
FROM eclipse-temurin:21-jre
@@ -75,16 +74,16 @@ RUN apt-get update \
7574
HEALTHCHECK --interval=10s --timeout=3s --retries=20 \
7675
CMD curl -fsS "http://127.0.0.1:${PORT}/" || exit 1
7776

78-
ENV JAVA_TOOL_OPTIONS="-Dserver.host=0.0.0.0 -Dhttp.port=${PORT} -Ddb.jdbc.url='jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?sslMode=PREFERRED&serverTimezone=UTC' -Ddb.schema=${DB_DATABASE} -Ddb.user=${DB_USER} -Ddb.password=${DB_PASSWORD} -Djdk.tls.client.protocols='TLSv1,TLSv1.1,TLSv1.2' -Dserver.gzip.enabled=false"
77+
ENV JAVA_TOOL_OPTIONS="-Dserver.address=0.0.0.0 -Dserver.port=${PORT} -Ddb.jdbc.url='jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?sslMode=PREFERRED&serverTimezone=UTC' -Ddb.schema=${DB_DATABASE} -Ddb.user=${DB_USER} -Ddb.password=${DB_PASSWORD} -Djdk.tls.client.protocols='TLSv1,TLSv1.1,TLSv1.2' -Dserver.gzip.enabled=false"
7978

8079
RUN addgroup --system app && adduser --system --ingroup app app
8180

82-
COPY --from=builder --chown=app:app /code/steve/target/steve.jar /app/
81+
COPY --from=builder --chown=app:app /code/steve/target/steve.war /app/
8382
COPY --from=builder --chown=app:app /code/steve/target/libs/ /app/libs/
8483

8584
USER app
8685

8786
EXPOSE ${PORT}
8887
EXPOSE 8443
8988

90-
CMD ["sh", "-c", "exec java -XX:MaxRAMPercentage=85 -jar /app/steve.jar"]
89+
CMD ["sh", "-c", "exec java -XX:MaxRAMPercentage=85 -jar /app/steve.war"]

pom.xml

Lines changed: 25 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>3.5.6</version>
9+
<relativePath />
10+
</parent>
11+
412
<groupId>de.rwth.idsg</groupId>
513
<artifactId>steve-parent</artifactId>
614
<version>3.8.0-SNAPSHOT</version>
@@ -32,20 +40,12 @@
3240
<maven.compiler.target>${java.version}</maven.compiler.target>
3341
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3442

35-
<build-tools.version>1.0.0</build-tools.version>
3643
<plugin.license-maven.version>5.0.0</plugin.license-maven.version>
37-
<plugin.cxf.version>4.1.3</plugin.cxf.version>
38-
44+
<cxf.version>4.1.3</cxf.version>
3945
<lombok.version>1.18.42</lombok.version>
40-
<jetty.version>12.1.1</jetty.version>
41-
<mysql.jdbc.version>9.4.0</mysql.jdbc.version>
46+
4247
<owasp-encoder.version>1.3.1</owasp-encoder.version>
43-
<slf4j.version>2.0.17</slf4j.version>
44-
<jooq.version>3.20.7</jooq.version>
45-
<flyway.version>11.12.0</flyway.version>
46-
<jaxb.version>4.0.10</jaxb.version>
47-
<cxf.version>4.1.3</cxf.version>
48-
<testcontainers.version>1.21.3</testcontainers.version>
48+
<jaxb-plugins.version>4.0.11</jaxb-plugins.version>
4949
</properties>
5050

5151
<dependencyManagement>
@@ -96,51 +96,9 @@
9696
<version>${project.version}</version>
9797
</dependency>
9898
<dependency>
99-
<groupId>org.springframework</groupId>
100-
<artifactId>spring-framework-bom</artifactId>
101-
<version>6.2.11</version>
102-
<type>pom</type>
103-
<scope>import</scope>
104-
</dependency>
105-
<dependency>
106-
<groupId>org.springframework.security</groupId>
107-
<artifactId>spring-security-bom</artifactId>
108-
<version>6.5.3</version>
109-
<type>pom</type>
110-
<scope>import</scope>
111-
</dependency>
112-
<dependency>
113-
<groupId>org.junit</groupId>
114-
<artifactId>junit-bom</artifactId>
115-
<version>5.13.4</version>
116-
<type>pom</type>
117-
<scope>import</scope>
118-
</dependency>
119-
<dependency>
120-
<groupId>com.fasterxml.jackson</groupId>
121-
<artifactId>jackson-bom</artifactId>
122-
<version>2.20.0</version>
123-
<type>pom</type>
124-
<scope>import</scope>
125-
</dependency>
126-
<dependency>
127-
<groupId>org.eclipse.jetty</groupId>
128-
<artifactId>jetty-bom</artifactId>
129-
<version>${jetty.version}</version>
130-
<type>pom</type>
131-
<scope>import</scope>
132-
</dependency>
133-
<dependency>
134-
<groupId>org.eclipse.jetty.ee10</groupId>
135-
<artifactId>jetty-ee10-bom</artifactId>
136-
<version>${jetty.version}</version>
137-
<type>pom</type>
138-
<scope>import</scope>
139-
</dependency>
140-
<dependency>
141-
<groupId>org.hibernate.validator</groupId>
142-
<artifactId>hibernate-validator-bom</artifactId>
143-
<version>9.0.1.Final</version>
99+
<groupId>org.apache.cxf</groupId>
100+
<artifactId>cxf-bom</artifactId>
101+
<version>${cxf.version}</version>
144102
<type>pom</type>
145103
<scope>import</scope>
146104
</dependency>
@@ -151,36 +109,19 @@
151109
<type>pom</type>
152110
<scope>import</scope>
153111
</dependency>
154-
<dependency>
155-
<groupId>jakarta.validation</groupId>
156-
<artifactId>jakarta.validation-api</artifactId>
157-
<version>3.1.1</version>
158-
</dependency>
159-
<dependency>
160-
<groupId>jakarta.annotation</groupId>
161-
<artifactId>jakarta.annotation-api</artifactId>
162-
<version>3.0.0</version>
163-
</dependency>
164-
<dependency>
165-
<groupId>jakarta.mail</groupId>
166-
<artifactId>jakarta.mail-api</artifactId>
167-
<version>2.1.4</version>
168-
</dependency>
169-
<dependency>
170-
<groupId>org.slf4j</groupId>
171-
<artifactId>slf4j-api</artifactId>
172-
<version>2.0.17</version>
173-
</dependency>
174-
<dependency>
175-
<groupId>ch.qos.logback</groupId>
176-
<artifactId>logback-classic</artifactId>
177-
<version>1.5.18</version>
178-
</dependency>
112+
179113
<dependency>
180114
<groupId>io.swagger.core.v3</groupId>
181115
<artifactId>swagger-annotations-jakarta</artifactId>
182116
<version>2.2.36</version>
183117
</dependency>
118+
<dependency>
119+
<groupId>org.testcontainers</groupId>
120+
<artifactId>testcontainers-bom</artifactId>
121+
<version>1.21.3</version>
122+
<type>pom</type>
123+
<scope>import</scope>
124+
</dependency>
184125
<!-- Codes according to ISO standards
185126
https://github.com/TakahikoKawasaki/nv-i18n -->
186127
<dependency>
@@ -193,16 +134,6 @@
193134
<artifactId>guava</artifactId>
194135
<version>33.4.8-jre</version>
195136
</dependency>
196-
<dependency>
197-
<groupId>org.assertj</groupId>
198-
<artifactId>assertj-core</artifactId>
199-
<version>3.27.4</version>
200-
</dependency>
201-
<dependency>
202-
<groupId>com.jayway.jsonpath</groupId>
203-
<artifactId>json-path</artifactId>
204-
<version>2.9.0</version>
205-
</dependency>
206137
<dependency>
207138
<groupId>net.bytebuddy</groupId>
208139
<artifactId>byte-buddy</artifactId>
@@ -220,7 +151,6 @@
220151
<dependency>
221152
<groupId>org.projectlombok</groupId>
222153
<artifactId>lombok</artifactId>
223-
<version>${lombok.version}</version>
224154
<scope>provided</scope>
225155
</dependency>
226156
</dependencies>
@@ -242,7 +172,6 @@
242172
<plugin>
243173
<groupId>org.apache.maven.plugins</groupId>
244174
<artifactId>maven-enforcer-plugin</artifactId>
245-
<version>3.6.1</version>
246175
<executions>
247176
<execution>
248177
<id>enforce-java</id>
@@ -267,8 +196,8 @@
267196
</executions>
268197
</plugin>
269198
<plugin>
199+
<groupId>org.apache.maven.plugins</groupId>
270200
<artifactId>maven-compiler-plugin</artifactId>
271-
<version>3.14.0</version>
272201
<configuration>
273202
<release>${java.version}</release>
274203
<compilerArgs>
@@ -298,19 +227,6 @@
298227
</annotationProcessorPaths>
299228
</configuration>
300229
</plugin>
301-
302-
<!-- We need min. this version for proper junit 5 support -->
303-
<plugin>
304-
<groupId>org.apache.maven.plugins</groupId>
305-
<artifactId>maven-surefire-plugin</artifactId>
306-
<version>3.5.4</version>
307-
</plugin>
308-
309-
<plugin>
310-
<groupId>org.apache.maven.plugins</groupId>
311-
<artifactId>maven-jar-plugin</artifactId>
312-
<version>3.4.2</version>
313-
</plugin>
314230
</plugins>
315231
</pluginManagement>
316232
<plugins>
@@ -322,8 +238,8 @@
322238
<licenseSets>
323239
<licenseSet>
324240
<inlineHeader><![CDATA[
325-
${name} - ${description} - ${url}
326-
Copyright (C) ${license.git.copyrightYears} ${owner}
241+
SteVe - SteckdosenVerwaltung - ${project.organization.url}
242+
Copyright (C) ${license.git.copyrightYears} ${project.organization.name}
327243
All Rights Reserved.
328244
329245
This program is free software: you can redistribute it and/or modify
@@ -339,12 +255,6 @@ GNU General Public License for more details.
339255
You should have received a copy of the GNU General Public License
340256
along with this program. If not, see <https://www.gnu.org/licenses/>.
341257
]]></inlineHeader>
342-
<properties>
343-
<name>SteVe</name>
344-
<description>SteckdosenVerwaltung</description>
345-
<url>${project.organization.url}</url>
346-
<owner>${project.organization.name}</owner>
347-
</properties>
348258
<excludes>
349259
<exclude>**/*.txt</exclude>
350260
<exclude>**/*.md</exclude>

steve-api/pom.xml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<dependency>
2323
<groupId>jakarta.servlet</groupId>
2424
<artifactId>jakarta.servlet-api</artifactId>
25-
<version>6.1.0</version>
25+
<scope>provided</scope>
2626
</dependency>
2727
<dependency>
2828
<groupId>org.springdoc</groupId>
@@ -31,33 +31,8 @@
3131
</dependency>
3232

3333
<dependency>
34-
<groupId>org.springframework</groupId>
35-
<artifactId>spring-test</artifactId>
36-
<scope>test</scope>
37-
</dependency>
38-
<dependency>
39-
<groupId>com.jayway.jsonpath</groupId>
40-
<artifactId>json-path</artifactId>
41-
<scope>test</scope>
42-
</dependency>
43-
<dependency>
44-
<groupId>org.junit.jupiter</groupId>
45-
<artifactId>junit-jupiter-engine</artifactId>
46-
<scope>test</scope>
47-
</dependency>
48-
<dependency>
49-
<groupId>org.junit.jupiter</groupId>
50-
<artifactId>junit-jupiter-params</artifactId>
51-
<scope>test</scope>
52-
</dependency>
53-
<dependency>
54-
<groupId>org.mockito</groupId>
55-
<artifactId>mockito-junit-jupiter</artifactId>
56-
<scope>test</scope>
57-
</dependency>
58-
<dependency>
59-
<groupId>org.assertj</groupId>
60-
<artifactId>assertj-core</artifactId>
34+
<groupId>org.springframework.boot</groupId>
35+
<artifactId>spring-boot-starter-test</artifactId>
6136
<scope>test</scope>
6237
</dependency>
6338
</dependencies>

0 commit comments

Comments
 (0)