Liberty: Maven goal - liberty:install-apps
You can use the liberty:install-apps goal to copy one or more applications to a Liberty server.
The liberty:install-apps goal copies applications specified as Maven dependencies to the dropins/ directory of the Liberty server. Only the Maven dependencies in compile scope are copied to the server. The server must exist and must not be running. The liberty:install-apps goal can be combined with the liberty:package-server goal to create a Liberty server archive with pre-installed applications.
Parameters
The following table describes parameters of the install-apps goal.
Parameter | Description | Required |
---|---|---|
serverHome | Directory location of the Liberty server installation. | Yes, only when assemblyArchive and assemblyArtifact parameters are not set. |
assemblyArchive | Location of the Liberty server compressed archive. The archive will be unpacked into a directory as specified by the installDirectory parameter. | Yes, only when serverHome and assemblyArtifact parameters are not set. |
assemblyArtifact | Maven artifact name of the Liberty server assembly. The assembly will be installed into a directory as specified by the installDirectory parameter. For more information on Liberty server Maven assemblies, see Liberty: Installation as a Maven artifact. | Yes, only when serverHome and assemblyArchive parameters are not set. |
installDirectory | Local installation directory location of the Liberty server when the server is installed using the assembly archive or artifact option. The default value is ${project.build.directory} /liberty. | No |
refresh | If true, re-install Liberty server into the local directory. This is only used when when the server is installed using the assembly archive or artifact option. The default value is false. | No |
serverName | Name of the Liberty server instance. The default value is defaultServer. | No |
- Example: installing application
- This is the code snippet that you can use in the pom.xml file of your project.
<build> ... <dependencies> <!-- Application to install and package --> <dependency> <groupId>wasdev</groupId> <artifactId>SimpleServlet</artifactId> <version>1.0</version> <type>war</type> </dependency> </dependencies> ... <plugins> <plugin> <groupId>com.ibm.websphere.wlp.maven.plugins</groupId> <artifactId>liberty-maven-plugin</artifactId> <version>1.0</version> <executions> ... <execution> <id>install-apps</id> <phase>compile</phase> <goals> <goal>install-apps</goal> </goals> </execution> ... <executions> <configuration> <serverHome>/opt/ibm/wlp</serverHome> <serverName>test</serverName> </configuration> </plugin> </plugins> ... </build>