The installApps
task copies applications generated by the Gradle project to the Liberty server's dropins
or apps
directory. Unlike the deploy task, installApps
performs a simple copy operation. It does not require the server to be running and does not check if the application was successfully deployed.
installApps
depends on any tasks of type war
or ear
so the package is ready before installation.
installApps
also depends on libertyCreate
to ensure that the server exists.
See the Liberty server configuration properties for common server configuration.
In particular, the apps
, dropins
, stripVersion
, and looseApplication
properties are used for application installation.
Loose Application is only supported by Gradle 4.0 or higher for tasks of type ear.
If you target an application to the dropins
folder, no configuration is needed to get the server to start the application. When you want to configure an application in server.xml, the location
is relative to the apps
folder. Applications in the apps
folder are not started without configuration. If you configure an application to install to the apps
folder and it is not configured, default configuration is created in the configDropins
folder.
Multiple applications can be installed to the apps
or dropins
directories. This can be done by adding application files, or the tasks that generate these files, to the respective list.
The libertyApp
configuration can be used to pull in application artifacts as dependencies and then install them to the server's apps
directory. You can specify the artifact as any type of object that can be resolved in to a Dependency object by Gradle. The application artifact still needs to be a supported application type of war
or ear
to be installed.
apply plugin: 'liberty'
apply plugin: 'war'
task libertyWarTask(type:War){
...
}
liberty {
server {
name = 'myServer'
apps = [file('build/libs/libertyApp.war'), libertyWarTask]
dropins = [war]
stripVersion = true
}
}
apply plugin: 'liberty'
apply plugin: 'ear'
liberty {
server {
name = 'myServer'
//assuming ear application is already configured in the server.xml
apps = [ear]
stripVersion = true
}
}
apply plugin: 'liberty'
dependencies {
libertyApp 'example:app:1.0'
}