springBootUtility thin command

The springBootUtility thin command creates a thin application and library cache from a fat Spring Boot application.

This command stores the dependent library JAR files of the application to the target library cache and packages the remaining application artifacts into a thin application JAR file. When a read-only parent library cache is specified, the command creates a target library cache that contains only the libraries that are not available in the parent cache. This action creates efficient container layers for Spring Boot applications.

Usage examples

Create the thin Spring Boot application with the springBootUtility thin command and the necessary options:

path_to_liberty/wlp/bin/springBootUtility thin
    --sourceAppPath=hellospringboot.jar
    --targetLibCachePath=path_to_liberty/wlp/usr/shared/resources/lib.index.cache
    --targetThinAppPath=path_to_liberty/wlp/usr/servers/helloserver/dropins/spring/hellospringboot.jar

Syntax

Run the command from the path_to_liberty/wlp/bin directory.

springBootUtility thin [options]

Options

The following options are available for the springBootUtility thin command:

Options for the springBootUtility thin command
OptionDescription

--sourceAppPath=path

The path of the source application file to thin. This option is required.

--parentLibCachePath=directory

The directory path of the parent read-only library cache. The parent library cache is searched first to locate existing libraries. If the library is not found, the library is stored in the writable library cache that is specified by the --targetLibCachePath option. If this option is not specified, no parent library cache is searched. This option is not required.

--targetLibCachePath=directory

The directory path that is used to save the library cache. If this option is not specified, a lib.index.cache directory is created in the parent directory of the source application. This option is not required.

--targetThinAppPath=file

The path that is used to save the thin application file. If this option is not specified, a new file is created with the .spring extension in the parent directory of the source application. This option is not required.

Exit codes

The following exit codes are available for the springBootUtility thin command:

Exit codes for the springBootUtility thin command
CodeExplanation

0

This code indicates successful completion of the requested operation.

>0

Exit codes that are greater than 0 indicate that the request encountered an error. Messages are printed with more information on the error.