Class PropertiesLauncher
java.lang.Object
org.springframework.boot.loader.launch.Launcher
org.springframework.boot.loader.launch.PropertiesLauncher
Launcher for archives with user-configured classpath and main class through a
 properties file.
 
 Looks in various places for a properties file to extract loader settings, defaulting to
 loader.properties either on the current classpath or in the current working
 directory. The name of the properties file can be changed by setting a System property
 loader.config.name (e.g. -Dloader.config.name=my will look for
 my.properties. If that file doesn't exist then tries
 loader.config.location (with allowed prefixes classpath: and
 file: or any valid URL). Once that file is located turns it into Properties and
 extracts optional values (which can also be provided overridden as System properties in
 case the file doesn't exist):
 
- loader.path: a comma-separated list of directories (containing file resources and/or nested archives in *.jar or *.zip or archives) or archives to append to the classpath.- BOOT-INF/classes,BOOT-INF/libin the application archive are always used
- loader.main: the main method to delegate execution to once the class loader is set up. No default, but will fall back to looking for a- Start-Classin a- MANIFEST.MF, if there is one in- ${loader.home}/META-INF.
- Since:
- 3.2.0
- Author:
- Dave Syer, Janne Valkealahti, Andy Wilkinson, Phillip Webb, Scott Frederick
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringProperties key for default command line arguments.static final StringProperties key for config file location (including optional classpath:, file: or URL prefix).static final StringProperties key for name of external configuration file (excluding suffix).static final StringProperties key for home directory.static final StringProperties key for main class.static final StringProperties key for classpath entries (directories possibly containing jars or jars).static final StringProperties key for boolean flag (default false) which, if set, will cause the external configuration properties to be copied to System properties (assuming that is allowed by Java security).Fields inherited from class org.springframework.boot.loader.launch.LauncherBOOT_CLASSPATH_INDEX_ATTRIBUTE, classPathIndex, DEFAULT_CLASSPATH_INDEX_FILE_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ClassLoadercreateClassLoader(Collection<URL> urls) Create a classloader for the specified archives.protected ArchiveReturn the archive being launched ornullif there is no archive.protected String[]Returns the archives that will be used to construct the class path.protected Fileprotected StringReturns the main class that should be launched.static voidstatic StringtoCamelCase(CharSequence string) Methods inherited from class org.springframework.boot.loader.launch.LaunchergetEntryPathPrefix, isExploded, isIncludedOnClassPath, isIncludedOnClassPathAndNotIndexed, isLibraryFileOrClassesDirectory, launch, launch
- 
Field Details- 
MAINProperties key for main class. As a manifest entry can also be specified asStart-Class.- See Also:
 
- 
PATHProperties key for classpath entries (directories possibly containing jars or jars). Multiple entries can be specified using a comma-separated list.BOOT-INF/classes,BOOT-INF/libin the application archive are always used.- See Also:
 
- 
HOMEProperties key for home directory. This is the location of external configuration if not on classpath, and also the base path for any relative paths in theloader path. Defaults to current working directory (${user.dir}).- See Also:
 
- 
ARGSProperties key for default command line arguments. These arguments (if present) are prepended to the main method arguments before launching.- See Also:
 
- 
CONFIG_NAMEProperties key for name of external configuration file (excluding suffix). Defaults to "application". Ignored ifloader config locationis provided instead.- See Also:
 
- 
CONFIG_LOCATIONProperties key for config file location (including optional classpath:, file: or URL prefix).- See Also:
 
- 
SET_SYSTEM_PROPERTIESProperties key for boolean flag (default false) which, if set, will cause the external configuration properties to be copied to System properties (assuming that is allowed by Java security).- See Also:
 
 
- 
- 
Constructor Details- 
PropertiesLauncher- Throws:
- Exception
 
 
- 
- 
Method Details- 
getHomeDirectory- Throws:
- Exception
 
- 
createClassLoaderDescription copied from class:LauncherCreate a classloader for the specified archives.- Overrides:
- createClassLoaderin class- Launcher
- Parameters:
- urls- the classpath URLs
- Returns:
- the classloader
- Throws:
- Exception- if the classloader cannot be created
 
- 
getArchiveDescription copied from class:LauncherReturn the archive being launched ornullif there is no archive.- Specified by:
- getArchivein class- Launcher
- Returns:
- the launched archive
 
- 
getMainClassDescription copied from class:LauncherReturns the main class that should be launched.- Specified by:
- getMainClassin class- Launcher
- Returns:
- the name of the main class
- Throws:
- Exception- if the main class cannot be obtained
 
- 
getArgs- Throws:
- Exception
 
- 
toCamelCase
- 
getClassPathUrlsDescription copied from class:LauncherReturns the archives that will be used to construct the class path.- Specified by:
- getClassPathUrlsin class- Launcher
- Returns:
- the class path archives
- Throws:
- Exception- if the class path archives cannot be obtained
 
- 
main- Throws:
- Exception
 
 
-