Tom Donohue Tom Donohue

Spring Boot command line arguments example

When you run a Spring Boot application from the command line, and you want to do any of the following:

Then start your application like this:

java [java options...] \
    -jar path/to/spring-boot-application.jar \, ... \, ... \


This example first compiles a Spring Boot application with Maven.

Then, it starts the application. It sets HTTPS proxy configuration, unlocks features for Mission Control, makes Spring use a local Profile, and sets some custom application properties:

$ mvn clean package
$ java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder \ \
    -Dhttps.proxyPort=8080 \
    -Dhttps.proxyUser=$PROXY_USER \
    -Dhttps.proxyPassword=$PROXY_PASS \
    -jar target/application-1.0.0-SNAPSHOT.jar \ \
    --breakfast.eggs=poached \


What do you think? You can use Markdown in your comment.

To write code, indent each line with 4 spaces. Or, to paste a lot of code, you can put it in and share the link in your comment.