Awe framework same as Spring Boot apps, has flexible packaging options provide a great deal of choice when it comes to deploying your application. You can deploy Awe applications to a variety of cloud platforms, to container images (such as Docker), or to virtual/real machines.
This section covers some of the more common deployment scenarios.
Awe applications can easily be packaged into JAR files and deployed as standalone applications. This is done by the
spring-boot-maven-plugin. The plugin is automatically added to pom.xml using
awe-boot-archetype maven archetype.
In order to package the application in a single (fat) jar file, run the maven command mvn package under project directory. This will package the application inside an executable jar file with all its dependencies (including the embedded servlet container — if its a web application). To run the jar file, use the following standard JVM command
java -jar <jar-file-name>.jar.
If you are running your application in an Application server like Apache Tomcat, Jboss, Websphere, ... you have to do a little changes in your pom.xml.
- Modify your
pom.xmlto generate a WAR package instead of a JAR
- Exclude the embedded tomcat by marking its scope as
- Modify your main class
AppBootApplication.javato start the application in a stand-alone servlet container.
Before deploying the application into a Docker container, we will first package the application in a (fat) JAR file. This process is previously explained, therefore I will assume we have a jar file. On the first step, we need to build a container image. For this, we start with creating a Dockerfile in the project root directory as follows:
Awe apps same as Spring Boot’s executable jars are ready-made for most popular cloud PaaS (Platform-as-a-Service) providers. These providers tend to require that you “bring your own container”. They manage application processes (not Java applications specifically), so they need an intermediary layer that adapts your application to the cloud’s notion of a running process.
Ideally, your application, like a Spring Boot executable jar, has everything that it needs to run packaged within it.
:::tip Info You can read more docs about deploying here :::