libertydiag
is a MicroProfile 5 and Jakarta EE 9 (Web Profile) web application for simulating diagnostic situations.
Running this application in production should be done with care because it may be used to execute various powerful functions.
Download libertydiag.war
from https://github.com/IBM/libertydiag/releases/latest
This application requires Liberty >= 22.0.0.1 and at least the following features to be installed:
<featureManager>
<feature>webProfile-9.1</feature>
<feature>microProfile-5.0</feature>
<featureManager>
The latest release is also built into an image at quay.io/ibm/libertydiag; for example:
podman run --rm -p 9080:9080 -p 9443:9443 -it quay.io/ibm/libertydiag
Then access at http://localhost:9080/ or https://localhost:9443/
There is also a Liberty InstantOn image at quay.io/ibm/libertydiag:instanton; for example:
podman run --pull=newer --rm --privileged -p 9080:9080 -p 9443:9443 -it quay.io/ibm/libertydiag:instanton
- Pre-requisities:
- Java >= 8 is required on your
PATH
; for example, IBM Semeru Runtimes - Using podman on macOS:
podman machine ssh "sudo rpm-ostree install qemu-user-static cpp && sudo systemctl reboot"
- Java >= 8 is required on your
- Build and run:
- macOS and Linux:
./mvnw clean liberty:dev
- Windows:
mvnw clean liberty:dev
- macOS and Linux:
- Wait for the message, "server is ready to run a smarter planet". For example:
CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 30.292 seconds.
- Open your browser to the HTTP or HTTPS page:
To develop in Eclipse:
- Install the Eclipse flavor: Eclipse IDE for Enterprise Java and Web Developers
- Start Eclipse and click File } Import... } Maven } Existing Maven Projects
- Example overriding variables:
./mvnw -Dliberty.var.HTTP_PORT=9081 -Dliberty.var.HTTPS_PORT=9444 clean liberty:dev
- Build WAR file and Liberty package:
./mvnw clean package
- Run Liberty in the console:
./mvnw clean liberty:run
- Run a specific version of Liberty:
./mvnw -Dliberty.runtime.version=22.0.0.10 clean liberty:run
- If you'd like to run the Liberty package as a jar:
java -jar target/libertydiag.jar
- Build container:
./mvnw clean deploy podman run --rm --platform linux/amd64 -p 9080:9080 -p 9443:9443 -it localhost/libertydiag:latest
- Build container with InstantOn:
./mvnw -Dimage.build.instanton=true clean deploy podman run --rm --privileged --platform linux/amd64 -p 9080:9080 -p 9443:9443 -it localhost/libertydiag:instanton
- Build container with normal logging:
./mvnw -Dimage.builder.arguments="--build-arg WLP_LOGGING_CONSOLE_FORMAT='SIMPLE' --build-arg WLP_LOGGING_CONSOLE_LOGLEVEL='INFO' --build-arg WLP_LOGGING_CONSOLE_SOURCE='message'" deploy
- Running
mvnw clean deploy
errors withAn Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "podman"
Ifpodman
is not on your path and you want to use, for example,docker
instead:./mvnw -Dimage.builder=docker deploy
- Running
mvnw clean deploy
errors withAn Ant BuildException has occured: exec returned:
Add-X
to show full output:./mvnw -X deploy
- Update the date in
pom.xml
in the line<version>0.1.$DATE</version>
and then commit and pushgit commit -a -s -S -m "Description of changes in this release"
git push
- Confirm that the push built successfully: https://github.com/IBM/libertydiag/actions
- Tag with the same version and push
git tag 0.1.$DATE
git push --tags
- On macOS, install
qemu-user-static
for cross-compilation:podman machine ssh "sudo rpm-ostree install qemu-user-static cpp && sudo systemctl reboot"
- Run:
./mvnw -Dimage.build.instanton=true -Dimage.manifest.repository.push=true clean deploy
- Confirm new build at https://quay.io/repository/ibm/libertydiag?tab=tags