PropertiesLauncher Features

This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Boot 4.1.1!

PropertiesLauncher has a few special features that can be enabled with external properties (System properties, environment variables, manifest entries, or loader.properties). The following table describes these properties:

Key Purpose
loader.path Comma-separated Classpath, such as lib,${HOME}/app/lib. Earlier entries take precedence, like a regular -classpath on the javac command line.
loader.home Used to resolve relative paths in loader.path. For example, given loader.path=lib, then ${loader.home}/lib is a classpath location (along with all jar files in that directory). This property is also used to locate a loader.properties file, as in the following example /opt/app It defaults to ${user.dir}.
loader.args Default arguments for the main method (space separated).
loader.main Name of main class to launch (for example, com.app.Application).
loader.config.name Name of properties file (for example, launcher). It defaults to loader.
loader.config.location Path to properties file (for example, classpath:loader.properties). It defaults to loader.properties.
loader.system Boolean flag to indicate that all properties should be added to System properties. It defaults to false.

When specified as environment variables or manifest entries, the following names should be used:

Key Manifest entry Environment variable
loader.path Loader-Path LOADER_PATH
loader.home Loader-Home LOADER_HOME
loader.args Loader-Args LOADER_ARGS
loader.main Start-Class LOADER_MAIN
loader.config.location Loader-Config-Location LOADER_CONFIG_LOCATION
loader.system Loader-System LOADER_SYSTEM
Build plugins automatically move the Main-Class attribute to Start-Class when the uber jar is built. If you use that, specify the name of the class to launch by using the Main-Class attribute and leaving out Start-Class.

The following rules apply to working with PropertiesLauncher: