Version 3.0 of the Liberty Maven Plugin introduces new functionality and configurations. When moving from 2.x, there are new features and behavior differences to take into consideration when updating your project.
The plugin is available under the new
io.openliberty.tools group id in the Maven Central repository.
- Maven dependencies
- New capabilities in the liberty-maven-plugin
- Behavior differences in the liberty-maven-plugin
Updates to the
liberty-maven-plugin require the use of Maven 3.5.0 or higher.
New capabilities in the liberty-maven-plugin
There are new capabilities available in the
liberty-maven-plugin that you might what to use when moving to release 3 of the plug-in.
There is a new
dev goal that starts a Liberty server in dev mode. Dev mode provides three key features. Code changes are detected, recompiled, and picked up by your running server. Unit and integration tests are run on demand when you press Enter in the command terminal where dev mode is running, or optionally on every code change to give you instant feedback on the status of your code. Finally, it allows you to attach a debugger to the running server at any time to step through your code.
Behavior differences in the liberty-maven-plugin
Removed alias goals and renamed goals
The following goal names are simplified:
|Previous goal name||New goal name|
Changes in parameter names and defaults for common server parameters
In the past, the
serverEnv common server parameters had default values. If the file existed in the
configDirectory though, that file took precedence. Now these common server parameters have no default values. If values are specified for these common server parameters, they will take precedence over files located in the
configDirectory defaults to
bootstrapProperties will take precedence over
jvmOptions will take precedence over
jvmOptionsFile. No merging is done.
|Previous parameter name||Previous default value||New parameter name||New default value|
Order of precedence (from highest to lowest):
- Inlined configuration - bootstrapProperties, jvmOptions
- Specified file - bootstrapPropertiesFile, jvmOptionsFile, serverEnvFile, serverXmlFile
- File located in
configDirectory(which defaults to
Simplified server installation
In the past, if no
assemblyArtifact was specified, the latest Liberty runtime was installed from DHE. Now by default, the latest Open Liberty runtime is installed from Maven Central. The new
liberty.runtime.version property can be specified on the command line or as a Maven property to override which version of Liberty is installed. Also,
assemblyArchive is renamed to
assemblyArtifact is renamed to
runtimeArtifact. These are common parameters shared by all goals.
Changed package goal
package goal is changed. The
runnable value is deprecated for the
include parameter. Use the new
packageType parameter with value
jar to generate a runnable Jar file. The
packageFile parameter is also removed. The
packageType should be used instead.
Changed deploy goal and removed install-apps goal
deploy goal is changed to handle both copying and deploying of applications to a Liberty server, depending on the status of the server. If the server is not running, the applications are simply copied onto the server. If the server is running, the applications are deployed and verified to have started on the server. The
install-apps goal is removed. The
looseApplication parameter has a new default value of
installAppPackages parameter is renamed
deployPackages and has a new default value of
appArtifact parameters are removed. The applications come from the project, the dependencies, or both.