Defining Spring Boot application arguments
You can deploy a Spring Boot application to Liberty and configure the arguments to override the application property defaults.
For the most current information about deploying Spring Boot applications to Liberty, see the Open Liberty website.
Before you begin
Install an existing helloserver
server
configuration with the enabled Liberty
features that are necessary to support the Spring Boot application.
About this task
java -jar hellospringboot.jar --server.context-path=/mypath --myapp.arg=true
SpringApplication
Spring Boot class converts any command line
argument that starts with dashes (--
) to a property and adds it to the Spring
Environment.--server.context-path=/mypath
When you deploy a Spring Boot application to Liberty, you can configure the command line
argument for the application with the applicationArgument
element within the
springBootApplication
element. Use these elements when you want to override
application property defaults that are included in the Spring Boot application.
In the example, the hellospringboot.jar Spring Boot application deployment
to Liberty is configured to pass multiple
command line arguments. The two properties that are used in the example are the Spring Boot 1.5
application properties for configuring the server.context-path
context path and the
server.servlet-path
Spring dispatcher servlet path.
For more information, see Spring Boot 1.5.x common application properties.