This is a prototype Maven plugin to package a Spring Boot application with Liberty.
When added to your pom.xml, the plugin will
- Install Open Liberty.
- Create an Open Liberty server.
- Thin the Spring Boot project application.
- Install the application to the server.
- Install and add appropriate Liberty features to the server configuration.
- Package the server and application into a runnable jar.
- Create a Spring Boot application Docker image that uses Liberty.
git clone git@github.com:OpenLiberty/boost-common.git
cd boost-common
mvn clean install
git clone git@github.com:OpenLiberty/boost-maven.git
cd boost-maven
mvn clean install
(To run integration tests, add the -Pit parameter)
Kick the tires of Boost with zero configuration:
-
Produce a Liberty uber jar for your Spring Boot app:
mvn clean package io.openliberty.boost:boost-maven-plugin:0.1:package
java -jar target/<application name>.jar
-
Create a Liberty based Docker image for your Spring Boot app:
mvn clean package io.openliberty.boost:boost-maven-plugin:0.1:docker-build
docker run -p 9080:9080 <application name>
- Add the following to your project pom.xml
<plugin> <groupId>io.openliberty.boost</groupId> <artifactId>boost-maven-plugin</artifactId> <version>0.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>package</goal> </goals> </execution> </executions> </plugin>
- Run
mvn clean package
- Run the produced jar file:
java -jar <application_name>.jar
- Add the following to your project pom.xml
<plugin> <groupId>io.openliberty.boost</groupId> <artifactId>boost-maven-plugin</artifactId> <version>0.1</version> <executions> <execution> <goals> <goal>docker-build</goal> </goals> </execution> </executions> </plugin>
- Run
mvn clean install
- Run the produced Docker image:
docker run -p 9080:9080 <application_name>
For a more detailed tutorial, see here.
See here