Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use artifactId in archetype (#189, partly #274) #291

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>