Skip to content

Commit

Permalink
Merge pull request #291 from geziefer/use-artifact-name
Browse files Browse the repository at this point in the history
Use artifactId in archetype (#189, partly #274)
  • Loading branch information
m-reza-rahman committed May 15, 2024
2 parents f8b2145 + e7a8382 commit 9ccb8f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions archetype/src/main/resources/archetype-resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ 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'))
You can also run the project via Docker. To build the Docker image, execute the following commands from the directory where this file resides. Please ensure you have installed a [Java SE 8+ implementation](https://adoptium.net/?variant=openjdk8) appropriate for your Jakarta EE version/runtime choice and [Docker](https://docs.docker.com/get-docker/) (we have tested with Java SE 8, Java SE 11 and Java SE 17). Note, the [Maven Wrapper](https://maven.apache.org/wrapper/) is already included in the project, so a Maven install is not actually needed. You may first need to execute `chmod +x mvnw`.

```
./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
Expand All @@ -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
4 changes: 2 additions & 2 deletions archetype/src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<version>${version}</version>
<packaging>war</packaging>

<name>jakartaee-hello-world</name>
<name>${artifactId}</name>
<description>
This is a very simple Jakarta EE application generated by the official Eclipse Starter.
</description>
Expand Down Expand Up @@ -112,7 +112,7 @@
</dependencies>

<build>
<finalName>jakartaee-hello-world</finalName>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443" />

<webApplication location="jakartaee-hello-world.war" contextRoot="/"/>
<webApplication location="${artifactId}.war" contextRoot="/"/>
</server>

0 comments on commit 9ccb8f0

Please sign in to comment.