In the previous step you added a custom CDI bean to the app. Now it's time to package and run it as a self-contained JAR file.
Stopping the Running Application
CTRL-Cto stop the application.
Packaging the Application
package goal to build the application JAR files:
getting-started-1.0.0-SNAPSHOT.jar- This JAR contains only the classes and resources of the projects; it’s the regular artifact produced by the Maven build
quarkus-app/quarkus-run.jar- The application is also packaged as an executable jar. Be aware that it’s not an über-jar as the dependencies are copied into several subdirectories (and would need to be included in any layered container image).
You can find these two files under the
ls -l target/*.jar target/quarkus-app/*.jar
Note: Quarkus uses the fast-jar packaging by default. The fast-jar packaging format is introduced as an alternative to the default jar packaging format. The main goal of this new format is to bring faster startup times.
Running the Executable JAR
java -jar target/quarkus-app/quarkus-run.jar
Class-Pathentry of the
MANIFEST.MFfrom the executable jar explicitly lists the JAR files from the subdirectories under
target/quarkus-app. If you want to deploy your application elsewhere, you need to copy the executable jar as well as the folder structure under
target/quarkus-app. If you want to create an Uber-jar with everything included, you can use
mvn package -DuberJar.
Stop the executable JAR by pressing
CTRL-C in its terminal.