diff --git a/gitlab/all-kaniko-builds.gitlab-ci.yml b/gitlab/all-kaniko-builds.gitlab-ci.yml index ccdc9940fa9efe486ef77b7dae6d1b77f7b9188c..d387063e9be8cd80602f56090f97fc635678163e 100644 --- a/gitlab/all-kaniko-builds.gitlab-ci.yml +++ b/gitlab/all-kaniko-builds.gitlab-ci.yml @@ -132,15 +132,6 @@ kaniko:xplan-manager-web: needs: - maven-prepare-docker-contexts-web-apps - kaniko:xplan-docker-tomcat - -kaniko:xplan-manager-web-hale: - extends: .kaniko:build - variables: - dockerImageName: xplan-manager-web-hale - tarGzFile: xplan-manager/xplan-manager-web/target/docker/xplanbox/xplan-manager-web-hale/tmp/docker-build.tar.gz - needs: - - maven-prepare-docker-contexts-web-apps - - kaniko:xplan-docker-tomcat kaniko:xplan-services: extends: .kaniko:build diff --git a/pom.xml b/pom.xml index 66a8e8d624c6555366a48553832d51f0ab3f5a71..47c1a68d7dc69dd5c490ad85e2085108c80a75f3 100644 --- a/pom.xml +++ b/pom.xml @@ -29,22 +29,21 @@ <log4j.version>2.23.1</log4j.version> <slf4j.version>2.0.13</slf4j.version> <spring.version>6.1.9</spring.version> - <spring-boot.version>3.3.0</spring-boot.version> + <spring-boot.version>3.3.2</spring-boot.version> <spring-batch.version>5.1.2</spring-batch.version> <spring-security.version>6.2.5</spring-security.version> <spring-data.version>3.2.7</spring-data.version> <hibernate.version>6.4.9.Final</hibernate.version> - <jackson.version>2.17.1</jackson.version> <liquibase.version>4.28.0</liquibase.version> <postgresql.version>42.7.3</postgresql.version> <picocli.version>4.7.6</picocli.version> - <owasp.version>10.0.2</owasp.version> + <owasp.version>10.0.3</owasp.version> <!-- API properties --> <base.package.name>de.latlon.xplanbox</base.package.name> <jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version> <jakarta.ws.rs-api.version>3.1.0</jakarta.ws.rs-api.version> <jersey.version>3.1.7</jersey.version> - <swagger.version>2.2.20</swagger.version> + <swagger.version>2.2.22</swagger.version> <!-- project properties --> <distribution.repo.id>gitlab-maven</distribution.repo.id> <distribution.repo.url>${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven</distribution.repo.url> @@ -397,7 +396,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> - <version>3.6.0</version> + <version>3.6.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -541,7 +540,7 @@ <plugin> <groupId>io.github.git-commit-id</groupId> <artifactId>git-commit-id-maven-plugin</artifactId> - <version>9.0.0</version> + <version>9.0.1</version> <executions> <execution> <id>get-the-git-infos</id> @@ -584,7 +583,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> - <version>3.3.0</version> + <version>3.3.1</version> <configuration> <argLine>-Xmx${tests.jvm.xmx} @{jacoco.argLine}</argLine> </configuration> @@ -603,7 +602,7 @@ <plugin> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> - <version>4.8.5.0</version> + <version>4.8.6.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -620,7 +619,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> - <version>3.1.0</version> + <version>3.1.1</version> <configuration> <preparationGoals>clean install</preparationGoals> <autoVersionSubmodules>true</autoVersionSubmodules> @@ -629,7 +628,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>3.3.0</version> + <version>3.3.1</version> <configuration> <argLine>-Xmx${tests.jvm.xmx} @{jacoco.argLine}</argLine> </configuration> @@ -666,7 +665,7 @@ <plugin> <groupId>org.jvnet.jaxb</groupId> <artifactId>jaxb-maven-plugin</artifactId> - <version>4.0.6</version> + <version>4.0.8</version> <executions> <execution> <id>xjc</id> @@ -684,12 +683,12 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> - <version>3.4.1</version> + <version>3.4.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>3.7.0</version> + <version>3.8.0</version> <configuration> <failOnError>false</failOnError> </configuration> @@ -712,7 +711,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> - <version>3.7.0</version> + <version>3.7.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -745,7 +744,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId> - <version>2.16.2</version> + <version>2.17.1</version> </plugin> <plugin> <groupId>org.jacoco</groupId> @@ -1178,10 +1177,16 @@ <artifactId>tika-core</artifactId> <version>2.8.0</version> </dependency> + <dependency> + <groupId>com.github.spotbugs</groupId> + <artifactId>spotbugs-annotations</artifactId> + <version>4.8.6</version> + <scope>provided</scope> + </dependency> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-bom</artifactId> - <version>1.12.745</version> + <version>1.12.765</version> <type>pom</type> <scope>import</scope> </dependency> diff --git a/xplan-core/xplan-core-commons/src/main/java/de/latlon/xplan/commons/hale/HaleTransformer.java b/xplan-core/xplan-core-commons/src/main/java/de/latlon/xplan/commons/hale/HaleTransformer.java index dc89bc427f70913d0f6e3e5b25525ffbdae66203..574032c97e7cc4a4dbfd6b99fe5a16df03b15670 100644 --- a/xplan-core/xplan-core-commons/src/main/java/de/latlon/xplan/commons/hale/HaleTransformer.java +++ b/xplan-core/xplan-core-commons/src/main/java/de/latlon/xplan/commons/hale/HaleTransformer.java @@ -20,15 +20,18 @@ */ package de.latlon.xplan.commons.hale; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static org.apache.commons.io.IOUtils.closeQuietly; -import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; import java.util.Map; -import java.util.function.Consumer; +import java.util.Optional; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author <a href="mailto:goltz@lat-lon.de">Lyn Goltz </a> @@ -39,11 +42,18 @@ public class HaleTransformer { private final String haleCli; + private final Optional<String> javaOpts; + /** - * @param haleCli the path to the the hale CLI, never <code>null</code> + * @param haleCli the path to the hale CLI, never <code>null</code> */ public HaleTransformer(String haleCli) { + this(haleCli, Optional.empty()); + } + + public HaleTransformer(String haleCli, Optional<String> javaOpts) { this.haleCli = haleCli; + this.javaOpts = javaOpts; } /** @@ -74,62 +84,64 @@ public class HaleTransformer { */ public void transform(String haleProject, String sourceFile, String targetFile, HaleIOProvider writer) throws TransformationException { + InputStream inputStream = null; try { - String command = buildCommand(haleProject, sourceFile, targetFile, writer); + List<String> command = buildCommand(haleProject, sourceFile, targetFile, writer); LOG.info("Execute the following command to transform the plan: {}", command); - Process process = Runtime.getRuntime().exec(command); - Thread gobblerThread = startGobblerThread(process); + ProcessBuilder processBuilder = new ProcessBuilder(command); + overwriteJavaOpts(processBuilder); + processBuilder.redirectErrorStream(true); + Process process = processBuilder.start(); + + inputStream = process.getInputStream(); + LOG.info(IOUtils.toString(inputStream)); int exitCode = process.waitFor(); - gobblerThread.join(); LOG.info("Transformation command finished with exit code {}. ", exitCode); } catch (IOException | InterruptedException e) { LOG.error("Could not transform", e); throw new TransformationException("Could not transform", e); } - } - - private String buildCommand(String haleProject, String source, String target, HaleIOProvider writer) { - StringBuilder sb = new StringBuilder(); - sb.append(haleCli); - sb.append(" transform"); - sb.append(" -project " + haleProject); - sb.append(" -source " + source); - sb.append(" -target " + target); - sb.append(" -providerId ").append(writer.getName()); - for (Map.Entry<String, String> setting : writer.getSettings().entrySet()) { - sb.append(" -S").append(setting.getKey()).append(" ").append(setting.getValue()).append(" "); + finally { + closeQuietly(inputStream); } - return sb.toString(); - } - - private Thread startGobblerThread(Process process) { - Thread gobblerThread; - StreamGobbler streamGobbler = new StreamGobbler(process.getInputStream(), - LOG.isDebugEnabled() ? System.out::println : s -> { - }); - gobblerThread = new Thread(streamGobbler); - gobblerThread.start(); - return gobblerThread; } - private static class StreamGobbler implements Runnable { - - private InputStream inputStream; - - private Consumer<String> consumer; - - public StreamGobbler(InputStream inputStream, Consumer<String> consumer) { - this.inputStream = inputStream; - this.consumer = consumer; + private void overwriteJavaOpts(ProcessBuilder processBuilder) { + Map<String, String> environment = processBuilder.environment(); + if (javaOpts.isEmpty()) { + LOG.info("Remove JAVA_OPTS"); + environment.remove("JAVA_OPTS"); } - - @Override - public void run() { - new BufferedReader(new InputStreamReader(inputStream)).lines().forEach(consumer); + else { + LOG.info("Set JAVA_OPTS: {}", javaOpts.get()); + environment.put("JAVA_OPTS", javaOpts.get()); + } + if (LOG.isDebugEnabled()) { + LOG.debug("Command starts with the following environment:"); + environment.forEach((k, v) -> LOG.debug(" - {}: {}", k, v)); } + } + private List<String> buildCommand(String haleProject, String source, String target, HaleIOProvider writer) { + List<String> command = new ArrayList<>(); + command.add(haleCli); + command.add("transform"); + command.add("-project"); + command.add(haleProject); + command.add("-source"); + command.add(source); + command.add("-target"); + command.add(target); + command.add("-providerId"); + command.add(writer.getName()); + for (Map.Entry<String, String> setting : writer.getSettings().entrySet()) { + command.add("-S"); + command.add(setting.getKey()); + command.add(setting.getValue()); + } + return command; } } diff --git a/xplan-core/xplan-core-inspireplu/src/main/java/de/latlon/xplan/inspire/plu/transformation/hale/HaleCliInspirePluTransformator.java b/xplan-core/xplan-core-inspireplu/src/main/java/de/latlon/xplan/inspire/plu/transformation/hale/HaleCliInspirePluTransformator.java index 94deee488e6b19cacbe3e62dae892131d5b3e398..8d23e11ced9a732069848dac17a707917cf8663e 100644 --- a/xplan-core/xplan-core-inspireplu/src/main/java/de/latlon/xplan/inspire/plu/transformation/hale/HaleCliInspirePluTransformator.java +++ b/xplan-core/xplan-core-inspireplu/src/main/java/de/latlon/xplan/inspire/plu/transformation/hale/HaleCliInspirePluTransformator.java @@ -20,10 +20,13 @@ */ package de.latlon.xplan.inspire.plu.transformation.hale; -import de.latlon.xplan.commons.XPlanVersion; -import de.latlon.xplan.commons.hale.HaleTransformer; -import de.latlon.xplan.commons.hale.TransformationException; -import de.latlon.xplan.inspire.plu.transformation.InspirePluTransformator; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_41; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_50; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_51; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_52; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_53; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_54; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_60; import java.io.IOException; import java.nio.file.Files; @@ -31,16 +34,14 @@ import java.nio.file.Path; import java.util.AbstractMap.SimpleEntry; import java.util.Collections; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_41; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_50; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_51; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_52; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_53; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_54; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_60; +import de.latlon.xplan.commons.XPlanVersion; +import de.latlon.xplan.commons.hale.HaleTransformer; +import de.latlon.xplan.commons.hale.TransformationException; +import de.latlon.xplan.inspire.plu.transformation.InspirePluTransformator; /** * @author <a href="mailto:goltz@lat-lon.de">Lyn Goltz </a> @@ -61,9 +62,9 @@ public class HaleCliInspirePluTransformator implements InspirePluTransformator { new SimpleEntry<>(XPLAN_60, "xplan60/xplanGml60-inspirePlu.halex")) .collect(Collectors.toMap((e) -> e.getKey(), (e) -> e.getValue()))); - public HaleCliInspirePluTransformator(String haleCli, Path haleProjectDirectory) { + public HaleCliInspirePluTransformator(String haleCli, Path haleProjectDirectory, Optional<String> javaOpts) { this.haleProjectDirectory = haleProjectDirectory; - this.haleTransformator = new HaleTransformer(haleCli); + this.haleTransformator = new HaleTransformer(haleCli, javaOpts); } @Override diff --git a/xplan-core/xplan-core-inspireplu/src/test/java/de/latlon/xplan/inspire/plu/transformation/HaleCliInspirePluTransformatorTest.java b/xplan-core/xplan-core-inspireplu/src/test/java/de/latlon/xplan/inspire/plu/transformation/HaleCliInspirePluTransformatorTest.java index b975d4b62f8ff8136ba6e9473fed8c1cb73bfdde..6f78ea80369b70b5162e67b532a425d2a5f0f0e9 100644 --- a/xplan-core/xplan-core-inspireplu/src/test/java/de/latlon/xplan/inspire/plu/transformation/HaleCliInspirePluTransformatorTest.java +++ b/xplan-core/xplan-core-inspireplu/src/test/java/de/latlon/xplan/inspire/plu/transformation/HaleCliInspirePluTransformatorTest.java @@ -20,10 +20,9 @@ */ package de.latlon.xplan.inspire.plu.transformation; -import de.latlon.xplan.inspire.plu.transformation.hale.HaleCliInspirePluTransformator; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.xmlunit.assertj3.XmlAssert; +import static de.latlon.xplan.commons.XPlanVersion.XPLAN_41; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.xmlunit.builder.Input.fromURI; import java.io.BufferedReader; import java.io.FileInputStream; @@ -33,10 +32,12 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; +import java.util.Optional; -import static de.latlon.xplan.commons.XPlanVersion.XPLAN_41; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.xmlunit.builder.Input.fromURI; +import de.latlon.xplan.inspire.plu.transformation.hale.HaleCliInspirePluTransformator; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.xmlunit.assertj3.XmlAssert; /** * @author <a href="mailto:goltz@lat-lon.de">Lyn Goltz </a> @@ -52,8 +53,8 @@ class HaleCliInspirePluTransformatorTest { @Test void testTransformationToPlu() throws Exception { - HaleCliInspirePluTransformator transformator = new HaleCliInspirePluTransformator(haleCli, - haleProjectDirectory); + HaleCliInspirePluTransformator transformator = new HaleCliInspirePluTransformator(haleCli, haleProjectDirectory, + Optional.empty()); Path inspirePlu = transformator.transformToPlu(Paths.get(testResource), XPLAN_41); assertNotNull(inspirePlu); diff --git a/xplan-core/xplan-core-synthesizer/pom.xml b/xplan-core/xplan-core-synthesizer/pom.xml index f741d5f0250d0d0d2187a64dec0a4e9de32bdb35..c1b6c9dc1839876318c52e87632f86b017d97bfc 100644 --- a/xplan-core/xplan-core-synthesizer/pom.xml +++ b/xplan-core/xplan-core-synthesizer/pom.xml @@ -41,7 +41,6 @@ <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-params</artifactId> - <version>5.10.2</version> <scope>test</scope> </dependency> <dependency> diff --git a/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/installation/hale-cli.adoc b/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/installation/hale-cli.adoc index 3479174fddfa4522bf61388b859142edc4fa81ad..afe09952ede92b13e8b7bded9a4e6b77de9aa95a 100644 --- a/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/installation/hale-cli.adoc +++ b/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/installation/hale-cli.adoc @@ -3,18 +3,6 @@ Für die Transformation von Plänen aus dem XPlanGML-Datenformat in das INSPIRE Planned Land Use (PLU) Format sowie der Transformation von XPlanGML 4.1 nach 5.1 wird die Software https://halestudio.org/[HALE] verwendet. Werden diese Transformationen nicht benötigt, dann ist die Installation des HALE CLI auch nicht erforderlich. -Für die Installation muss zunächst das HALE CLI 3.4.0 (ZIP-Datei) von der Projektseite auf GitHub https://github.com/halestudio/hale-cli/releases/tag/v3.4.0[https://github.com/halestudio/hale-cli] heruntergeladen werden. Anschließend muss die Datei auf dem Server, auf dem XPlanManagerWeb, XPlanManagerAPI oder das XPlanTransform_CLI installiert wird, entpackt werden. - -IMPORTANT: Die Version 3.4.0 des HALE CLI erfordert ein JDK 8 und kann *nicht* mit JDK 11 ausgeführt werden. Zusätzlich zu dem JDK 11, das für alle xPlanBox-Komponenten erforderlich ist (siehe Kapitel <<jdk>>) muss ein JDK 8 installiert werden (Download von https://adoptium.net/?variant=openjdk8&jvmVariant=hotspot[AdoptOpenJDK 1.8]). - -Tragen Sie den Pfad zum Installationsverzeichnis des JDK unter Linux in die Datei _hale_ unterhalb des Kommentarblocks wie folgt ein: -[source,bash] -JAVA_HOME=/pfad/zum/jdk - -Für das Betriebssystem Windows passen Sie die Datei _hale.bat_ an und fügen unterhalb des Kommentarblocks folgende Zeile hinzu: -[source,bash] -JAVA_HOME=LAUFWERK:/pfad/zum/jdk - -WARNING: Setzen Sie den Pfad zum JDK 1.8 nicht global mit `export` unter Linux bzw. `set` unter Windows, da sonst auch die Komponenten der xPlanBox mit dieser Java Version ausgeführt werden. +Für die Installation muss zunächst das HALE CLI 5.1.0 (ZIP-Datei) von der Projektseite auf GitHub https://github.com/halestudio/hale-cli/releases/tag/v5.1.0[https://github.com/halestudio/hale-cli] heruntergeladen werden. Anschließend muss die Datei auf dem Server, auf dem XPlanManagerWeb installiert wird, entpackt werden. Die Konfiguration von HALE für die Verwendung in den Komponenten der xPlanBox ist im Kapitel <<konfiguration-hale>> beschrieben. \ No newline at end of file diff --git a/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/konfiguration/manager/hale.adoc b/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/konfiguration/manager/hale.adoc index 7bb84e6a819ca1b8f90ca3b433d8087b336ba9e1..20d11d390e2b07ee81dcac1ba6e015d851b797b4 100644 --- a/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/konfiguration/manager/hale.adoc +++ b/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/konfiguration/manager/hale.adoc @@ -10,4 +10,6 @@ Um dem XPlanManager die Nutzung des HALE CLI zu ermöglichen, muss in der Datei pathToHaleCli=/hale/bin/hale ---- -TIP: Unter Linux heisst die Datei _hale_ unter dem Betriebssystem Windows _hale.bat_. \ No newline at end of file +TIP: Unter Linux heisst die Datei _hale_ unter dem Betriebssystem Windows _hale.bat_. + +TIP: Um z.B. den verfügbaren Arbeitsspeicher für die Transformation zu setzen, kann dies kann durch Setzen der Umgebungsvariable: `export XPLAN_INSPIREPLU_TRANSF_JAVA_OPTS='-Xmx4096m'` erfolgen. \ No newline at end of file diff --git a/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/ueberblick.adoc b/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/ueberblick.adoc index 714633aa93cc6dbab058e4c426a94d4afdd02c49..9cfd7dd588d4cc6e1550f4ddce19abdbe452f207 100644 --- a/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/ueberblick.adoc +++ b/xplan-documentation/xplan-betriebshandbuch/src/main/asciidoc/ueberblick.adoc @@ -106,4 +106,4 @@ IMPORTANT: Unterstützt wird MapProxy 1.16.0. Optional kann das https://github.com/halestudio/hale-cli/[HALE CLI] installiert werden. Wenn Daten der xPlanBox transformiert werden sollen, dann ist der Einsatz des HALE CLI erforderlich. Weitere Informationen zur Installation befinden sich im Abschnitt <<installation-hale-cli>>. -IMPORTANT: Unterstützt wird HALE CLI 3.4.0. \ No newline at end of file +IMPORTANT: Unterstützt wird HALE CLI 5.1.0. \ No newline at end of file diff --git a/xplan-dokumente/xplan-dokumente-api/pom.xml b/xplan-dokumente/xplan-dokumente-api/pom.xml index bb6631ed0e35e869ca122899e2e0bbb94243de69..11225398f26ca986fd77c5d7b22737cdf11517e9 100755 --- a/xplan-dokumente/xplan-dokumente-api/pom.xml +++ b/xplan-dokumente/xplan-dokumente-api/pom.xml @@ -193,6 +193,10 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> <!-- logging --> <dependency> <groupId>org.slf4j</groupId> diff --git a/xplan-dokumente/xplan-dokumente-api/src/main/java/de/latlon/xplanbox/api/dokumente/config/JerseyConfig.java b/xplan-dokumente/xplan-dokumente-api/src/main/java/de/latlon/xplanbox/api/dokumente/config/JerseyConfig.java index 8ab8332ab28528387a8a59f68458734e0edd3e85..2778a57f6fa742607526d6a5abfde47d1799c44f 100644 --- a/xplan-dokumente/xplan-dokumente-api/src/main/java/de/latlon/xplanbox/api/dokumente/config/JerseyConfig.java +++ b/xplan-dokumente/xplan-dokumente-api/src/main/java/de/latlon/xplanbox/api/dokumente/config/JerseyConfig.java @@ -31,7 +31,6 @@ import de.latlon.xplanbox.api.commons.openapi.OpenApiFilter; import de.latlon.xplanbox.api.dokumente.v1.DefaultApi; import de.latlon.xplanbox.api.dokumente.v1.DokumentApi; import de.latlon.xplanbox.api.dokumente.v1.InfoApi; -import de.latlon.xplanbox.api.dokumente.v1.StatusApi; import io.swagger.v3.oas.integration.SwaggerConfiguration; import io.swagger.v3.oas.models.ExternalDocumentation; import io.swagger.v3.oas.models.OpenAPI; @@ -80,7 +79,6 @@ public class JerseyConfig extends ResourceConfig { register(InfoApi.class); register(DokumentApi.class); - register(StatusApi.class); register(ConstraintViolationExceptionMapper.class); register(UnsupportedContentTypeExceptionMapper.class); register(ValidatorExceptionMapper.class); diff --git a/xplan-dokumente/xplan-dokumente-api/src/main/java/de/latlon/xplanbox/api/dokumente/v1/StatusApi.java b/xplan-dokumente/xplan-dokumente-api/src/main/java/de/latlon/xplanbox/api/dokumente/v1/StatusApi.java deleted file mode 100644 index c19ba9aa20799bf7a9c1bd7ec5a7246c182714b6..0000000000000000000000000000000000000000 --- a/xplan-dokumente/xplan-dokumente-api/src/main/java/de/latlon/xplanbox/api/dokumente/v1/StatusApi.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * #%L - * xplan-dokumente-api - Software zur Verwaltung von XPlanGML Daten - * %% - * Copyright (C) 2008 - 2024 Freie und Hansestadt Hamburg, developed by lat/lon gesellschaft für raumbezogene Informationssysteme mbH - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package de.latlon.xplanbox.api.dokumente.v1; - -import io.swagger.v3.oas.annotations.Hidden; -import io.swagger.v3.oas.annotations.Operation; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.Response; - -/** - * Minimal end-point for liveness probes. To be replaced by Spring-boot health actuator. - * - * @author <a href="mailto:goltz@lat-lon.de">Lyn Goltz</a> - * @since 7.0 - */ -@Path("/status") -@Hidden -public class StatusApi { - - @GET - @Produces({ "text/plain" }) - @Operation(summary = "Internal API") - public Response status() { - return Response.ok().entity("ok").build(); - } - -} diff --git a/xplan-dokumente/xplan-dokumente-api/src/main/resources/application.properties b/xplan-dokumente/xplan-dokumente-api/src/main/resources/application.properties index e393166abc224707b9bd62fbb39309962e345032..e77f2ecec3030e93bb555161c57d0058026d6abc 100644 --- a/xplan-dokumente/xplan-dokumente-api/src/main/resources/application.properties +++ b/xplan-dokumente/xplan-dokumente-api/src/main/resources/application.properties @@ -24,3 +24,5 @@ logging.level.root=warn logging.level.de.latlon=debug logging.level.org.springframework.web=debug logging.level.org.hibernate=error + +management.endpoint.health.probes.enabled=true diff --git a/xplan-dokumente/xplan-dokumente-api/src/test/java/de/latlon/xplanbox/api/dokumente/config/TestContext.java b/xplan-dokumente/xplan-dokumente-api/src/test/java/de/latlon/xplanbox/api/dokumente/config/TestContext.java index 08276899b963364bde69fff6cb26b36973cf68cb..94c17c14fa50bfa8193c47f221840ee50eeb364c 100644 --- a/xplan-dokumente/xplan-dokumente-api/src/test/java/de/latlon/xplanbox/api/dokumente/config/TestContext.java +++ b/xplan-dokumente/xplan-dokumente-api/src/test/java/de/latlon/xplanbox/api/dokumente/config/TestContext.java @@ -27,7 +27,6 @@ import de.latlon.xplanbox.api.dokumente.service.DocumentHeaderWithStream; import de.latlon.xplanbox.api.dokumente.v1.DefaultApi; import de.latlon.xplanbox.api.dokumente.v1.DokumentApi; import de.latlon.xplanbox.api.dokumente.v1.InfoApi; -import de.latlon.xplanbox.api.dokumente.v1.StatusApi; import de.latlon.xplanbox.api.dokumente.v1.model.Document; import org.apache.commons.io.IOUtils; import org.glassfish.jersey.server.ResourceConfig; @@ -56,7 +55,6 @@ public class TestContext { jerseyConfig.register(DokumentApi.class); jerseyConfig.register(InfoApi.class); jerseyConfig.register(DefaultApi.class); - jerseyConfig.register(StatusApi.class); return jerseyConfig; } diff --git a/xplan-dokumente/xplan-dokumente-api/src/test/java/de/latlon/xplanbox/api/dokumente/v1/StatusApiTest.java b/xplan-dokumente/xplan-dokumente-api/src/test/java/de/latlon/xplanbox/api/dokumente/v1/StatusApiTest.java deleted file mode 100644 index a5b5dd8d88ffe84027a7b6e077c0dcdf86792386..0000000000000000000000000000000000000000 --- a/xplan-dokumente/xplan-dokumente-api/src/test/java/de/latlon/xplanbox/api/dokumente/v1/StatusApiTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * #%L - * xplan-dokumente-api - Software zur Verwaltung von XPlanGML Daten - * %% - * Copyright (C) 2008 - 2024 Freie und Hansestadt Hamburg, developed by lat/lon gesellschaft für raumbezogene Informationssysteme mbH - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package de.latlon.xplanbox.api.dokumente.v1; - -import de.latlon.xplanbox.api.dokumente.config.ApplicationContext; -import de.latlon.xplanbox.api.dokumente.config.TestContext; -import org.apache.http.HttpHeaders; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.test.JerseyTest; -import org.glassfish.jersey.test.TestProperties; -import org.junit.jupiter.api.Test; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -import jakarta.ws.rs.core.Application; -import jakarta.ws.rs.core.Response; - -import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN; -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * @author <a href="mailto:goltz@lat-lon.de">Lyn Goltz</a> - * @since 7.0 - */ -class StatusApiTest extends JerseyTest { - - @Override - protected Application configure() { - enable(TestProperties.LOG_TRAFFIC); - final ResourceConfig resourceConfig = new ResourceConfig(StatusApi.class); - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ApplicationContext.class, - TestContext.class); - resourceConfig.property("contextConfig", context); - return resourceConfig; - } - - @Test - void verifyThat_Response_ContainsCorrectStatusCodeAndMediaType() { - final Response response = target("/status").request().get(); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); - assertEquals(TEXT_PLAIN, response.getHeaderString(HttpHeaders.CONTENT_TYPE)); - } - -} diff --git a/xplan-manager/xplan-manager-api/pom.xml b/xplan-manager/xplan-manager-api/pom.xml index 8fe348b87a9667a9aab71c3ac8c6ea3f197a383c..62847743c9ce797a9b39ae25f5f58b3482045621 100644 --- a/xplan-manager/xplan-manager-api/pom.xml +++ b/xplan-manager/xplan-manager-api/pom.xml @@ -215,7 +215,7 @@ </exclusion> </exclusions> </dependency> - <dependency> + <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> <exclusions> @@ -236,7 +236,11 @@ <artifactId>snakeyaml</artifactId> </exclusion> </exclusions> - </dependency> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> <!-- logging --> <dependency> <groupId>org.slf4j</groupId> diff --git a/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/SpringBootApp.java b/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/SpringBootApp.java index 6f180ed9f6570afeaa241bfc38ae87c298c344d1..1bfe5b1d43588ea08990d46f46724cd6c401ba3a 100644 --- a/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/SpringBootApp.java +++ b/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/SpringBootApp.java @@ -8,12 +8,12 @@ * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% @@ -21,6 +21,7 @@ package de.latlon.xplanbox.api.manager; import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; @@ -33,8 +34,8 @@ import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan( basePackages = { "de.latlon.xplanbox.api.manager.config", "de.latlon.xplanbox.api.manager.messagingrabbitmq" }) -@EnableAutoConfiguration( - exclude = { QuartzAutoConfiguration.class, LiquibaseAutoConfiguration.class, SecurityAutoConfiguration.class }) +@EnableAutoConfiguration(exclude = { QuartzAutoConfiguration.class, LiquibaseAutoConfiguration.class, + SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class }) public class SpringBootApp extends SpringBootServletInitializer { public static void main(String[] args) { diff --git a/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/config/JerseyConfig.java b/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/config/JerseyConfig.java index b2434cc13adbeea6c723c06e38caf750cbcd3c31..d7c799200cbcc1c8990e5666643f10d20cf9aa1b 100644 --- a/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/config/JerseyConfig.java +++ b/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/config/JerseyConfig.java @@ -40,7 +40,6 @@ import de.latlon.xplanbox.api.manager.v1.PlanGueltigkeitApi; import de.latlon.xplanbox.api.manager.v1.PlanRasterbasisApi; import de.latlon.xplanbox.api.manager.v1.PlanTextApi; import de.latlon.xplanbox.api.manager.v1.PlansApi; -import de.latlon.xplanbox.api.manager.v1.Status; import io.swagger.v3.oas.integration.SwaggerConfiguration; import io.swagger.v3.oas.models.ExternalDocumentation; import io.swagger.v3.oas.models.OpenAPI; @@ -97,7 +96,6 @@ public class JerseyConfig extends ResourceConfig { register(PlanRasterbasisApi.class); register(PlansApi.class); register(PlanTextApi.class); - register(Status.class); register(ConstraintViolationExceptionMapper.class); register(UnsupportedContentTypeExceptionMapper.class); register(ValidatorExceptionMapper.class); diff --git a/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/v1/Status.java b/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/v1/Status.java deleted file mode 100644 index 1c75403f264a225fc5d518c9991db1759c1993f0..0000000000000000000000000000000000000000 --- a/xplan-manager/xplan-manager-api/src/main/java/de/latlon/xplanbox/api/manager/v1/Status.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * #%L - * xplan-manager-api - Software zur Verwaltung von XPlanGML Daten - * %% - * Copyright (C) 2008 - 2024 Freie und Hansestadt Hamburg, developed by lat/lon gesellschaft für raumbezogene Informationssysteme mbH - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package de.latlon.xplanbox.api.manager.v1; - -import java.io.IOException; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.Response; - -import io.swagger.v3.oas.annotations.Hidden; -import io.swagger.v3.oas.annotations.Operation; - -/** - * Minimal end-point for liveness probes. To be replaced by Spring-boot health actuator. - * - * @since 7.0 - */ -@Path("/status") -@Hidden -public class Status { - - @GET - @Produces({ "text/plain" }) - @Operation(summary = "Internal API") - public Response status() throws IOException { - return Response.ok().entity("ok").build(); - } - -} diff --git a/xplan-manager/xplan-manager-api/src/main/resources/application.properties b/xplan-manager/xplan-manager-api/src/main/resources/application.properties index 3287d296a04a1b3098a9f0e63bf42e0f42da0f6a..fb6b50101fe2ac2a1d8ff91331738e7b4b965b50 100644 --- a/xplan-manager/xplan-manager-api/src/main/resources/application.properties +++ b/xplan-manager/xplan-manager-api/src/main/resources/application.properties @@ -27,6 +27,8 @@ logging.level.de.latlon=debug logging.level.org.springframework.web=debug logging.level.org.hibernate=error +management.endpoint.health.probes.enabled=true + spring.rabbitmq.host=${XPLAN_RABBIT_HOST:localhost} spring.rabbitmq.password=${XPLAN_RABBIT_PASSWORD:guest} spring.rabbitmq.port=${XPLAN_RABBIT_PORT:5672} diff --git a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan41/xplanGml41-inspirePlu.halex b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan41/xplanGml41-inspirePlu.halex index c496bb7cece81b7e41832e4110fe4ac52348c786..a0bbbfb49de61d7a685a0adabc23b6d38f91d346 100644 --- a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan41/xplanGml41-inspirePlu.halex +++ b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan41/xplanGml41-inspirePlu.halex @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<hale-project version="3.5.0.release"> +<hale-project version="5.1.0.release"> <name>XPlan GML 4.1 to INSPRE PLU</name> <author>lat/lon GmbH</author> <created>2017-10-23T06:12:00.060Z</created> - <modified>2020-06-03T06:19:14.735Z</modified> + <modified>2024-06-05T17:25:52.085+02:00</modified> <save-config action-id="project.save" provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer"> <setting name="charset">UTF-8</setting> <setting name="projectFiles.separate">false</setting> diff --git a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan50/xplanGml50-inspirePlu.halex b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan50/xplanGml50-inspirePlu.halex index 1e8d85011375ee664721bcb189a4c144e946d0cc..791770b99a43931be42380eb94d94143f6d19575 100644 --- a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan50/xplanGml50-inspirePlu.halex +++ b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan50/xplanGml50-inspirePlu.halex @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<hale-project version="3.5.0.release"> +<hale-project version="5.1.0.release"> <name>XPlan GML 5.0 to INSPRE PLU</name> <author>lat/lon GmbH</author> <created>2018-11-19T13:09:54.783Z</created> - <modified>2022-06-09T05:57:08.210Z</modified> + <modified>2024-06-05T17:25:52.085+02:00</modified> <save-config action-id="project.save" provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer"> <setting name="charset">UTF-8</setting> <setting name="projectFiles.separate">false</setting> diff --git a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan51/xplanGml51-inspirePlu.halex b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan51/xplanGml51-inspirePlu.halex index 2adba1c8318698ff48ae1b9c1cbf5259675c7d33..2035dc0ac54e45624893f96e5eb49ea74cfc26dc 100644 --- a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan51/xplanGml51-inspirePlu.halex +++ b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan51/xplanGml51-inspirePlu.halex @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<hale-project version="3.5.0.release"> +<hale-project version="5.1.0.release"> <name>XPlan GML 5.1 to INSPRE PLU</name> <author>lat/lon GmbH</author> <created>2018-11-19T13:09:54.783Z</created> - <modified>2022-06-09T05:56:16.631Z</modified> + <modified>2024-06-05T17:25:52.085+02:00</modified> <save-config action-id="project.save" provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer"> <setting name="charset">UTF-8</setting> <setting name="projectFiles.separate">false</setting> diff --git a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan52/xplanGml52-inspirePlu.halex b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan52/xplanGml52-inspirePlu.halex index 84664bb38169b9a91aa68240d9f65ec04015143f..f9a338a8578ec7525fab714c087ab2b01f29a12a 100644 --- a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan52/xplanGml52-inspirePlu.halex +++ b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan52/xplanGml52-inspirePlu.halex @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<hale-project version="3.5.0.release"> +<hale-project version="5.1.0.release"> <name>XPlan GML 5.2 to INSPRE PLU</name> <author>lat/lon GmbH</author> <created>2018-11-19T13:09:54.783Z</created> - <modified>2022-06-09T06:00:07.696Z</modified> + <modified>2024-06-05T17:25:52.085+02:00</modified> <save-config action-id="project.save" provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer"> <setting name="charset">UTF-8</setting> <setting name="projectFiles.separate">false</setting> diff --git a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan53/xplanGml53-inspirePlu.halex b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan53/xplanGml53-inspirePlu.halex index 850164894a9686292106aa03df85f994ab19d888..703c0b15dd65ff5c762b1ecaf7b629b2e94282be 100644 --- a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan53/xplanGml53-inspirePlu.halex +++ b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan53/xplanGml53-inspirePlu.halex @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<hale-project version="3.5.0.release"> +<hale-project version="5.1.0.release"> <name>XPlan GML 5.3 to INSPRE PLU</name> <author>lat/lon GmbH</author> <created>2020-01-06T07:10:46.571Z</created> - <modified>2022-06-09T05:58:32.869Z</modified> + <modified>2024-06-05T17:25:52.085+02:00</modified> <save-config action-id="project.save" provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer"> <setting name="charset">UTF-8</setting> <setting name="projectFiles.separate">false</setting> diff --git a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan54/xplanGml54-inspirePlu.halex b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan54/xplanGml54-inspirePlu.halex index 6a5ac3e03cc98d12dbc80311fee64c3d931dd596..1a87fb7f9c593da3da5fed975fc3b58da3fb08dd 100644 --- a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan54/xplanGml54-inspirePlu.halex +++ b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan54/xplanGml54-inspirePlu.halex @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<hale-project version="3.5.0.release"> +<hale-project version="5.1.0.release"> <name>XPlan GML 5.4 to INSPRE PLU</name> <author>lat/lon GmbH</author> <created>2020-01-06T07:10:46.571Z</created> - <modified>2022-06-09T05:47:20.829Z</modified> + <modified>2024-06-05T17:25:52.085+02:00</modified> <save-config action-id="project.save" provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer"> <setting name="charset">UTF-8</setting> <setting name="projectFiles.separate">false</setting> diff --git a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan60/xplanGml60-inspirePlu.halex b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan60/xplanGml60-inspirePlu.halex index 62685555ef92672b7d7a6008741da6763d23355b..cecc62a23bf4eca4b36fdd5c9827695fddc34157 100644 --- a/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan60/xplanGml60-inspirePlu.halex +++ b/xplan-manager/xplan-manager-config/src/main/resources/hale/xplan60/xplanGml60-inspirePlu.halex @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<hale-project version="4.1.0.release"> +<hale-project version="5.1.0.release"> <name>XPlan GML 6.0 to INSPRE PLU</name> <author>lat/lon GmbH</author> <created>2020-01-06T08:10:46.571+01:00</created> - <modified>2022-05-18T14:15:38.143+02:00</modified> + <modified>2024-06-05T17:25:52.085+02:00</modified> <save-config action-id="project.save" provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer"> <setting name="charset">UTF-8</setting> <setting name="projectFiles.separate">false</setting> diff --git a/xplan-manager/xplan-manager-web/Dockerfile b/xplan-manager/xplan-manager-web/Dockerfile index db91a77289780484e7f386e5fdf8b2f6216ed809..15ca2904bf09a0e4b37420d51f2b294c7786d7bc 100644 --- a/xplan-manager/xplan-manager-web/Dockerfile +++ b/xplan-manager/xplan-manager-web/Dockerfile @@ -27,6 +27,10 @@ ENV DEEGREE_WORKSPACE_ROOT=/xplanbox/deegree \ USER root +# add hale-cli +RUN apt update && apt -y install wget unzip +RUN cd / && wget https://github.com/halestudio/hale-cli/releases/download/v5.1.0/hale-5.1.0.zip -O /hale-5.1.0.zip && unzip hale-5.1.0.zip && mv /hale-5.1.0 hale + # add xplan-manager-web directly unpacked ADD target/xplan-manager-web-*.war /tmp/ RUN mkdir /opt/bitnami/tomcat/webapps/$WEB_CONTEXT \ diff --git a/xplan-manager/xplan-manager-web/DockerfileHale b/xplan-manager/xplan-manager-web/DockerfileHale deleted file mode 100644 index 5a4b8b554a7d4e1fd7e70e80d614249f4b40f2b1..0000000000000000000000000000000000000000 --- a/xplan-manager/xplan-manager-web/DockerfileHale +++ /dev/null @@ -1,44 +0,0 @@ -ARG XPLANBOX_VERSION=latest -ARG XPLANBOX_IMAGE_NAME_PREFIX=xplanbox - -FROM ${XPLANBOX_IMAGE_NAME_PREFIX}/xplan-docker-tomcat:$XPLANBOX_VERSION -ARG BUILD_DATE=? -ARG DOCKER_IMAGE_NAME=? -ARG GIT_REVISION=? -ARG WEB_CONTEXT=xplan-manager-web -ARG XPLANBOX_VERSION=latest - -# see https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys -LABEL "org.opencontainers.image.created"="$BUILD_DATE" \ - "org.opencontainers.image.description"="ozgxplanung xPlanBox component" \ - "org.opencontainers.image.licenses"="GNU Affero General Public License & others" \ - "org.opencontainers.image.ref.name"="$DOCKER_IMAGE_NAME" \ - "org.opencontainers.image.revision"="$GIT_REVISION" \ - "org.opencontainers.image.title"="ozgxplanung - $DOCKER_IMAGE_NAME" \ - "org.opencontainers.image.url"="https://gitlab.opencode.de/diplanung/ozgxplanung" \ - "org.opencontainers.image.vendor"="lat/lon GmbH" \ - "org.opencontainers.image.version"="$XPLANBOX_VERSION" - -# set environment variables -ENV DEEGREE_WORKSPACE_ROOT=/xplanbox/deegree \ - TOMCAT_ADDITIONAL_ARG_APP="-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl -Djts.overlay=ng -Duser.timezone=Europe/Berlin" \ - TOMCAT_ADDITIONAL_ARG_JAVA17_EXPORTS="--add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED" \ - XPLANBOX_CONFIG="/xplanbox/xplan-manager-config/" - -USER root - -# add hale-cli which is using Java 8 JDK (TODO: Umsetzung von https://lgv-hamburg.atlassian.net/browse/XPLANBOX-2695) -RUN apt update && apt -y install wget unzip -RUN cd / && wget https://github.com/halestudio/hale-cli/releases/download/v3.4.0/hale-cli-3.4.0.zip && unzip hale-cli-3.4.0.zip -# RUN apt update && apt -y install openjdk-8-jdk -RUN sed -i '2iJAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' /hale/bin/hale - -# add xplan-manager-web directly unpacked -ADD target/xplan-manager-web-*.war /tmp/ -RUN mkdir /opt/bitnami/tomcat/webapps/$WEB_CONTEXT \ - && cd /opt/bitnami/tomcat/webapps/$WEB_CONTEXT \ - && jar xf /tmp/xplan-manager-web-*.war \ - && rm /tmp/xplan-manager-web-*.war - - -USER 1001 \ No newline at end of file diff --git a/xplan-manager/xplan-manager-web/pom.xml b/xplan-manager/xplan-manager-web/pom.xml index 6fbd6162e7705c84fd74872140ce6320f9756d40..7e82215a77f12b2e110551444d761f6362ffb4a6 100644 --- a/xplan-manager/xplan-manager-web/pom.xml +++ b/xplan-manager/xplan-manager-web/pom.xml @@ -177,8 +177,6 @@ <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> - <version>${jackson.version}</version> - <classifier>sources</classifier> <type>jar</type> </dependency> <dependency> @@ -310,36 +308,6 @@ <artifactId>regeln-brandenburg</artifactId> </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>io.fabric8</groupId> - <artifactId>docker-maven-plugin</artifactId> - <configuration> - <images> - <image> - <name>${docker-image.namePrefix}/${docker-image.name}</name> - </image> - <image> - <name>${docker-image.namePrefix}/${docker-image.name}-hale</name> - <build> - <contextDir>${project.basedir}</contextDir> - <dockerFile>DockerfileHale</dockerFile> - <args> - <XPLANBOX_VERSION>${project.version}</XPLANBOX_VERSION> - <XPLANBOX_IMAGE_NAME_PREFIX>${docker-image.namePrefix}</XPLANBOX_IMAGE_NAME_PREFIX> - <WEB_CONTEXT>${project.artifactId}</WEB_CONTEXT> - </args> - <tags> - <tag>${project.version}</tag> - </tags> - </build> - </image> - </images> - </configuration> - </plugin> - </plugins> - </build> </profile> </profiles> </project> diff --git a/xplan-manager/xplan-manager-web/src/main/java/de/latlon/xplan/manager/web/spring/config/BasicSpringConfig.java b/xplan-manager/xplan-manager-web/src/main/java/de/latlon/xplan/manager/web/spring/config/BasicSpringConfig.java index cac7f2fb2814f494915921d9f902970a68f8cdda..f0257d3dfca51315c95ff4b755f649a2005287c0 100644 --- a/xplan-manager/xplan-manager-web/src/main/java/de/latlon/xplan/manager/web/spring/config/BasicSpringConfig.java +++ b/xplan-manager/xplan-manager-web/src/main/java/de/latlon/xplan/manager/web/spring/config/BasicSpringConfig.java @@ -334,11 +334,12 @@ public class BasicSpringConfig { } @Bean - public InspirePluTransformator inspirePluTransformator(ManagerConfiguration managerConfiguration) { + public InspirePluTransformator inspirePluTransformator(ManagerConfiguration managerConfiguration, + @Value("#{environment.XPLAN_INSPIREPLU_TRANSF_JAVA_OPTS}") Optional<String> javaOpts) { String pathToHaleCli = managerConfiguration.getPathToHaleCli(); Path pathToHaleProjectDirectory = managerConfiguration.getPathToHaleProjectDirectory(); if (pathToHaleCli != null && pathToHaleProjectDirectory != null) - return new HaleCliInspirePluTransformator(pathToHaleCli, pathToHaleProjectDirectory); + return new HaleCliInspirePluTransformator(pathToHaleCli, pathToHaleProjectDirectory, javaOpts); return null; } diff --git a/xplan-validator/xplan-validator-api/pom.xml b/xplan-validator/xplan-validator-api/pom.xml index 8938e6b893d0e5dd2bb045ce5af1a7189250d3df..de6d8d55463c55516531705b05dc14ad654c3d4d 100755 --- a/xplan-validator/xplan-validator-api/pom.xml +++ b/xplan-validator/xplan-validator-api/pom.xml @@ -262,7 +262,11 @@ <artifactId>snakeyaml</artifactId> </exclusion> </exclusions> - </dependency> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> <!-- logging --> <dependency> <groupId>org.slf4j</groupId> diff --git a/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/SpringBootApp.java b/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/SpringBootApp.java index 980cc13fe3d33fca9f410bc42464b63e5a7bb876..c8388b2511925bdad417b50c2e4b07d755aaa26f 100644 --- a/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/SpringBootApp.java +++ b/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/SpringBootApp.java @@ -24,6 +24,7 @@ import jakarta.servlet.ServletContext; import jakarta.servlet.ServletException; import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; @@ -33,7 +34,7 @@ import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages = { "de.latlon.xplanbox.api.validator.config" }) -@EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class }) +@EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class }) public class SpringBootApp extends SpringBootServletInitializer { public static void main(String[] args) { diff --git a/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/config/JerseyConfig.java b/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/config/JerseyConfig.java index b35a10e2e9c0d009f7206d34131740628a4f0c8b..5010b71060e96e7a4764170c79f86b420946813a 100644 --- a/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/config/JerseyConfig.java +++ b/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/config/JerseyConfig.java @@ -29,7 +29,6 @@ import de.latlon.xplanbox.api.commons.exception.XPlanApiExceptionMapper; import de.latlon.xplanbox.api.commons.openapi.OpenApiFilter; import de.latlon.xplanbox.api.validator.v1.DefaultApi; import de.latlon.xplanbox.api.validator.v1.InfoApi; -import de.latlon.xplanbox.api.validator.v1.Status; import de.latlon.xplanbox.api.validator.v1.ValidateApi; import io.swagger.v3.oas.integration.SwaggerConfiguration; import io.swagger.v3.oas.models.ExternalDocumentation; @@ -78,7 +77,6 @@ public class JerseyConfig extends ResourceConfig { register(InfoApi.class); register(ValidateApi.class); - register(Status.class); register(ConstraintViolationExceptionMapper.class); register(UnsupportedContentTypeExceptionMapper.class); register(ValidatorExceptionMapper.class); diff --git a/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/v1/Status.java b/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/v1/Status.java deleted file mode 100644 index 6ac3e36800322bab643a4e690020f81f2a77b268..0000000000000000000000000000000000000000 --- a/xplan-validator/xplan-validator-api/src/main/java/de/latlon/xplanbox/api/validator/v1/Status.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * #%L - * xplan-validator-api - Software zur Verwaltung von XPlanGML Daten - * %% - * Copyright (C) 2008 - 2024 Freie und Hansestadt Hamburg, developed by lat/lon gesellschaft für raumbezogene Informationssysteme mbH - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package de.latlon.xplanbox.api.validator.v1; - -import java.io.IOException; - -import io.swagger.v3.oas.annotations.Hidden; -import io.swagger.v3.oas.annotations.Operation; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.Response; - -/** - * Minimal end-point for liveness probes. To be replaced by Spring-boot health actuator. - * - * @since 7.0 - */ -@Path("/status") -@Hidden -public class Status { - - @GET - @Produces({ "text/plain" }) - @Operation(summary = "Internal API") - public Response status() throws IOException { - return Response.ok().entity("ok").build(); - } - -} diff --git a/xplan-validator/xplan-validator-api/src/main/resources/application.properties b/xplan-validator/xplan-validator-api/src/main/resources/application.properties index 14e452faa6644ccff3ca5be20677d871397a3be6..d22f6272514b062643ebfd6b24a1859b97d736b5 100644 --- a/xplan-validator/xplan-validator-api/src/main/resources/application.properties +++ b/xplan-validator/xplan-validator-api/src/main/resources/application.properties @@ -25,6 +25,8 @@ logging.level.de.latlon=debug logging.level.org.springframework.web=debug logging.level.org.hibernate=error +management.endpoint.health.probes.enabled=true + spring.rabbitmq.host=${XPLAN_RABBIT_HOST:localhost} spring.rabbitmq.password=${XPLAN_RABBIT_PASSWORD:guest} spring.rabbitmq.port=${XPLAN_RABBIT_PORT:5672} diff --git a/xplan-webservices/xplan-webservices-inspireplu/src/test/resources/de/latlon/xplan/services/inspireplu/libs.expected.txt b/xplan-webservices/xplan-webservices-inspireplu/src/test/resources/de/latlon/xplan/services/inspireplu/libs.expected.txt index b88d250267a2a3a90bfd36b9bffd368fffdf9137..4dd535b658a6f601e4b9d01f0e981f815ca47117 100644 --- a/xplan-webservices/xplan-webservices-inspireplu/src/test/resources/de/latlon/xplan/services/inspireplu/libs.expected.txt +++ b/xplan-webservices/xplan-webservices-inspireplu/src/test/resources/de/latlon/xplan/services/inspireplu/libs.expected.txt @@ -114,10 +114,10 @@ imageio-ext-streams-1.1.29.jar imageio-ext-tiff-1.1.29.jar imageio-ext-utilities-1.1.29.jar istack-commons-runtime-4.1.2.jar -jackson-annotations-2.17.1.jar -jackson-core-2.17.1.jar -jackson-databind-2.17.1.jar -jackson-dataformat-yaml-2.17.1.jar +jackson-annotations-2.17.2.jar +jackson-core-2.17.2.jar +jackson-databind-2.17.2.jar +jackson-dataformat-yaml-2.17.2.jar jai-codec-1.1.3.jar jai-core-1.1.3.jar jai_imageio-1.1.jar diff --git a/xplan-webservices/xplan-webservices-services/xplan-services-wfs-syn/src/test/resources/de/latlon/xplan/services/synwfs/libs.expected.txt b/xplan-webservices/xplan-webservices-services/xplan-services-wfs-syn/src/test/resources/de/latlon/xplan/services/synwfs/libs.expected.txt index 10beaf4b9f82eb2c43dc9f74eb0f6e49a663c3d7..4baf1860504e12cf292739a888bf99bc05495c56 100644 --- a/xplan-webservices/xplan-webservices-services/xplan-services-wfs-syn/src/test/resources/de/latlon/xplan/services/synwfs/libs.expected.txt +++ b/xplan-webservices/xplan-webservices-services/xplan-services-wfs-syn/src/test/resources/de/latlon/xplan/services/synwfs/libs.expected.txt @@ -114,10 +114,10 @@ imageio-ext-streams-1.1.29.jar imageio-ext-tiff-1.1.29.jar imageio-ext-utilities-1.1.29.jar istack-commons-runtime-4.1.2.jar -jackson-annotations-2.17.1.jar -jackson-core-2.17.1.jar -jackson-databind-2.17.1.jar -jackson-dataformat-yaml-2.17.1.jar +jackson-annotations-2.17.2.jar +jackson-core-2.17.2.jar +jackson-databind-2.17.2.jar +jackson-dataformat-yaml-2.17.2.jar jai-codec-1.1.3.jar jai-core-1.1.3.jar jai_imageio-1.1.jar diff --git a/xplan-webservices/xplan-webservices-services/xplan-services-wfs/src/test/resources/de/latlon/xplanbox/services/wfs/libs.expected.txt b/xplan-webservices/xplan-webservices-services/xplan-services-wfs/src/test/resources/de/latlon/xplanbox/services/wfs/libs.expected.txt index b88d250267a2a3a90bfd36b9bffd368fffdf9137..4dd535b658a6f601e4b9d01f0e981f815ca47117 100644 --- a/xplan-webservices/xplan-webservices-services/xplan-services-wfs/src/test/resources/de/latlon/xplanbox/services/wfs/libs.expected.txt +++ b/xplan-webservices/xplan-webservices-services/xplan-services-wfs/src/test/resources/de/latlon/xplanbox/services/wfs/libs.expected.txt @@ -114,10 +114,10 @@ imageio-ext-streams-1.1.29.jar imageio-ext-tiff-1.1.29.jar imageio-ext-utilities-1.1.29.jar istack-commons-runtime-4.1.2.jar -jackson-annotations-2.17.1.jar -jackson-core-2.17.1.jar -jackson-databind-2.17.1.jar -jackson-dataformat-yaml-2.17.1.jar +jackson-annotations-2.17.2.jar +jackson-core-2.17.2.jar +jackson-databind-2.17.2.jar +jackson-dataformat-yaml-2.17.2.jar jai-codec-1.1.3.jar jai-core-1.1.3.jar jai_imageio-1.1.jar diff --git a/xplan-webservices/xplan-webservices-services/xplan-services-wms/src/test/resources/de/latlon/xplan/services/wms/libs.expected.txt b/xplan-webservices/xplan-webservices-services/xplan-services-wms/src/test/resources/de/latlon/xplan/services/wms/libs.expected.txt index 082d4bd060f300ba6b51ab30cbff8e5728ddf1ae..cd79a64539fd8ed3d1682012fa116523c6d2846f 100644 --- a/xplan-webservices/xplan-webservices-services/xplan-services-wms/src/test/resources/de/latlon/xplan/services/wms/libs.expected.txt +++ b/xplan-webservices/xplan-webservices-services/xplan-services-wms/src/test/resources/de/latlon/xplan/services/wms/libs.expected.txt @@ -115,10 +115,10 @@ imageio-ext-streams-1.1.29.jar imageio-ext-tiff-1.1.29.jar imageio-ext-utilities-1.1.29.jar istack-commons-runtime-4.1.2.jar -jackson-annotations-2.17.1.jar -jackson-core-2.17.1.jar -jackson-databind-2.17.1.jar -jackson-dataformat-yaml-2.17.1.jar +jackson-annotations-2.17.2.jar +jackson-core-2.17.2.jar +jackson-databind-2.17.2.jar +jackson-dataformat-yaml-2.17.2.jar jai-codec-1.1.3.jar jai-core-1.1.3.jar jai_imageio-1.1.jar diff --git a/xplan-webservices/xplan-webservices-validator-wms/src/test/resources/de/latlon/xplan/validator/wms/libs.expected.txt b/xplan-webservices/xplan-webservices-validator-wms/src/test/resources/de/latlon/xplan/validator/wms/libs.expected.txt index 3a73fe7d7e3ab101ebeb366e5ae89926036c9281..33c42d2c13dccb9c89a88f01938b1d2b6e6e3eb2 100644 --- a/xplan-webservices/xplan-webservices-validator-wms/src/test/resources/de/latlon/xplan/validator/wms/libs.expected.txt +++ b/xplan-webservices/xplan-webservices-validator-wms/src/test/resources/de/latlon/xplan/validator/wms/libs.expected.txt @@ -114,10 +114,10 @@ imageio-ext-streams-1.1.29.jar imageio-ext-tiff-1.1.29.jar imageio-ext-utilities-1.1.29.jar istack-commons-runtime-4.1.2.jar -jackson-annotations-2.17.1.jar -jackson-core-2.17.1.jar -jackson-databind-2.17.1.jar -jackson-dataformat-yaml-2.17.1.jar +jackson-annotations-2.17.2.jar +jackson-core-2.17.2.jar +jackson-databind-2.17.2.jar +jackson-dataformat-yaml-2.17.2.jar jai-codec-1.1.3.jar jai-core-1.1.3.jar jai_imageio-1.1.jar @@ -152,8 +152,8 @@ log4j-layout-template-json-2.23.1.jar log4j-slf4j2-impl-2.23.1.jar log4j-web-2.23.1.jar mchange-commons-java-0.2.15.jar -micrometer-commons-1.13.0.jar -micrometer-observation-1.13.0.jar +micrometer-commons-1.13.2.jar +micrometer-observation-1.13.2.jar org.glassfish.jaxb-jaxb-core-4.0.5.jar postgis-geometry-2023.1.0.jar postgis-jdbc-2023.1.0.jar @@ -164,14 +164,14 @@ quartz-2.3.2.jar Saxon-HE-9.9.1-8.jar slf4j-api-2.0.13.jar snakeyaml-2.2.jar -spring-aop-6.1.8.jar -spring-beans-6.1.8.jar -spring-context-6.1.8.jar -spring-context-support-6.1.8.jar -spring-core-6.1.8.jar -spring-expression-6.1.8.jar -spring-jcl-6.1.8.jar -spring-tx-6.1.8.jar +spring-aop-6.1.11.jar +spring-beans-6.1.11.jar +spring-context-6.1.11.jar +spring-context-support-6.1.11.jar +spring-core-6.1.11.jar +spring-expression-6.1.11.jar +spring-jcl-6.1.11.jar +spring-tx-6.1.11.jar stax2-api-4.2.jar staxon-1.2.jar tika-core-2.8.0.jar