From 52e1707940387f980c6cd440359c198ec9f1aa99 Mon Sep 17 00:00:00 2001 From: Alexander Ruehl Date: Thu, 28 Dec 2023 10:58:18 +0100 Subject: [PATCH 1/2] Use artifact id in archetype files instead of default value --- .../src/main/resources/archetype-resources/README.md | 12 ++++++------ .../src/main/resources/archetype-resources/pom.xml | 4 ++-- .../src/main/liberty/config/server.xml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/archetype/src/main/resources/archetype-resources/README.md b/archetype/src/main/resources/archetype-resources/README.md index a0be265c..a8e3b34c 100644 --- a/archetype/src/main/resources/archetype-resources/README.md +++ b/archetype/src/main/resources/archetype-resources/README.md @@ -24,7 +24,7 @@ Once the runtime starts, you can access the project at http://localhost:8080. #elseif (${runtime} == 'open-liberty') Once the runtime starts, you can access the project at http://localhost:9080. #else -Once the runtime starts, you can access the project at http://localhost:8080/jakartaee-hello-world. +Once the runtime starts, you can access the project at http://localhost:8080/${artifactId}. #end #if ((${docker} == 'yes') and (${runtime} != 'glassfish')) @@ -32,21 +32,21 @@ You can also run the project via Docker. To build the Docker image, execute the ``` ./mvnw clean package -docker build -t jakartaee-hello-world:v1 . +docker build -t ${artifactId}:v1 . ``` You can then run the Docker image by executing: ``` #if (${runtime} != 'open-liberty') -docker run -it --rm -p 8080:8080 jakartaee-hello-world:v1 +docker run -it --rm -p 8080:8080 ${artifactId}:v1 #else -docker run -it --rm -p 9080:9080 jakartaee-hello-world:v1 +docker run -it --rm -p 9080:9080 ${artifactId}:v1 #end ``` #if (${runtime} != 'open-liberty') -Once the runtime starts, you can access the project at http://localhost:8080/jakartaee-hello-world. +Once the runtime starts, you can access the project at http://localhost:8080/${artifactId}. #else Once the runtime starts, you can access the project at http://localhost:9080/. #end @@ -58,6 +58,6 @@ Once the runtime starts, you can access the project at http://localhost:9080/. ./mvnw clean package ``` - This will generate a file named `jakartaee-hello-world.war`. You should be able to run the application by deploying the file to + This will generate a file named `${artifactId}.war`. You should be able to run the application by deploying the file to a [Jakarta EE compatible runtime](https://jakarta.ee/compatibility). #end \ No newline at end of file diff --git a/archetype/src/main/resources/archetype-resources/pom.xml b/archetype/src/main/resources/archetype-resources/pom.xml index cdb9f395..3b61ac49 100644 --- a/archetype/src/main/resources/archetype-resources/pom.xml +++ b/archetype/src/main/resources/archetype-resources/pom.xml @@ -50,7 +50,7 @@ ${version} war - jakartaee-hello-world + ${artifactId} This is a very simple Jakarta EE application generated by the official Eclipse Starter. @@ -112,7 +112,7 @@ - jakartaee-hello-world + ${artifactId} org.apache.maven.plugins diff --git a/archetype/src/main/resources/archetype-resources/src/main/liberty/config/server.xml b/archetype/src/main/resources/archetype-resources/src/main/liberty/config/server.xml index 349c3269..6cd60bff 100644 --- a/archetype/src/main/resources/archetype-resources/src/main/liberty/config/server.xml +++ b/archetype/src/main/resources/archetype-resources/src/main/liberty/config/server.xml @@ -30,5 +30,5 @@ - + From 7ef0391fc990cc6e1b6518665bd857bca9612937 Mon Sep 17 00:00:00 2001 From: Alexander Ruehl Date: Sun, 31 Dec 2023 14:38:16 +0100 Subject: [PATCH 2/2] Somehow this file escaped IntelliJ's search - use artifactId as war file name --- archetype/src/main/resources/archetype-resources/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archetype/src/main/resources/archetype-resources/Dockerfile b/archetype/src/main/resources/archetype-resources/Dockerfile index 1f1430a6..bc2190e9 100644 --- a/archetype/src/main/resources/archetype-resources/Dockerfile +++ b/archetype/src/main/resources/archetype-resources/Dockerfile @@ -85,7 +85,7 @@ FROM $baseImage #if (${runtime} == 'open-liberty') COPY src/main/liberty/config/server.xml /config/server.xml #end -COPY target/jakartaee-hello-world.war $deployDirectory +COPY target/${artifactId}.war $deployDirectory #if ((${runtime} == 'wildfly') && (${profile} == 'full')) CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c","standalone-full.xml"] #end \ No newline at end of file