Building an executable application is the first step in deploying Business Services to your production environment. There are several types of executables you can create, and trade-offs vary depending on your requirements. This section covers building with the two supported frameworks: Quarkus and Spring Boot.
While both frameworks offer convenient ways for building Container images and/or other types of excecutables directly from your Business Services projects, you are not constrainted by them. You are free to use any other build method, technique, tool or workflow you find suitable for your team and organization.
Quarkus
When you build your Business Service with Quarkus, there are a few different strategies you can choose to build executables. Since you are in control of your Business Service project on BAMOE, you can choose which strategy better suits your envisoned architecture.
Following the official Quarkus guides will help you choose which strategy is a better match for you.
-
a. Container image (recommended): Business Services on BAMOE usually get deployed to a hybrid-cloud environment, like OpenShift or Kubernetes. To build your Business Service project as an executable Container image, follow the official Quarkus guide at Container Images.
For standard use-cases, run the following command:
mvn clean install -Dquarkus.container-image.build=true
A Container image will be now installed to your local Container image registry. You can see it with:
docker image ls
Container images created with Quarkus can be both JVM- or Native Executable-based.
-
b. Native Executable: Follow the official Quarkus guide at Building a Native Executable.
For standard use-cases, run the following command:
mvn clean install -Dnative
The Native Executable will be on the
target/
directory and you can execute it with./target/{your-business-service-name}-{version}-runner
For more information on supported and tested environments see Supported environments. See Known limitations for more information on BAMOE native support.
-
c. Standard JAR: Business Services projects on BAMOE are Maven projects. For more information on how to create executable JARs with Maven, see the official Maven documentation at How to create a JAR. Since Quarkus is included in your Business Service project, an executable JAR will be produced for you. See more information about types of executable JARs in Using fast-jar and Uber-jar creation.
For standard use-cases, run the following command:
mvn clean package
Your executable JAR will be on the
target/
directory and you can execute it withjava -jar target/quarkus-app/quarkus-run.jar
Spring Boot
Standard Maven or Java commands are required to package and start the generated application:
mvn clean package
java -jar ./target/(name_of_the_application).jar