Skip to content

Latest commit

 

History

History
103 lines (99 loc) · 5.31 KB

deploy.md

File metadata and controls

103 lines (99 loc) · 5.31 KB

deploy


Deploy or copy applications specified as either Maven compile dependencies or the Maven project package to Liberty server's dropins or apps directory. This goal can be used when the server is not running to copy applications onto the server, or when the server is running to deploy applications and verify that they have started. To install Spring Boot applications on Liberty see Spring Boot Support.

Additional Parameters

The following are the parameters supported by this goal in addition to the common parameters.

Parameter Description Required
appsDirectory The server's apps or dropins directory where the application files should be copied. The default value is set to apps if the application is defined in the server configuration, otherwise it is set to dropins. No
copyLibsDirectory The optional directory to which loose application dependencies referenced by the loose application configuration file are copied. For example, if you want loose application dependencies to be contained within the build directory, you could set this parameter to target. The loose application configuration file will reference this directory for the loose application dependencies instead of the local repository cache. Only applicable when looseApplication is set to true. No
deployPackages The Maven packages to copy to Liberty runtime's application directory. One of dependencies, project, spring-boot-project or all. The default is project.
For an ear type project, this parameter is ignored and only the project package is installed.
No
looseApplication Generate a loose application configuration XML file representing the Maven project package and copy it to the Liberty server's apps or dropins directory, for a project with packaging types liberty-assembly, war, or ear. The default value is true. When using the packaging type liberty-assembly, using a combination of deployPackages set to all or project and looseApplication set to true results in the installation of application code provided in the project without the need of adding additional goals to your POM file. No
stripVersion Strip artifact version when copying the application to Liberty runtime's application directory. The default value is false. No
timeout Maximum time to wait (in seconds) to verify that the deployment has completed successfully. The default value is 40 seconds. No

Example: Copy the Maven project dependencies.

<project>
    ...
    <dependencies>
        <!-- SimpleServlet.war specified as a dependency -->
        <dependency>
            <groupId>wasdev</groupId>
            <artifactId>SimpleServlet</artifactId>
            <version>1.0</version>
            <type>war</type>
        </dependency>
    </dependencies>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <executions>
                    ...
                    <execution>
                        <id>deploy</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                        <configuration>
                            <appsDirectory>apps</appsDirectory>
                            <deployPackages>dependencies</deployPackages>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                    ...
                </executions>
                <configuration>
                   <installDirectory>/opt/ibm/wlp</installDirectory>
                   <serverName>test</serverName>
                </configuration>
            </plugin>
        </plugins>
    </build>
    ...
</project>

Copy the Maven project package.

<project>
    <groupId>wasdev</groupId>
    <artifactId>SimpleServlet</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <executions>
                    ...
                    <execution>
                        <id>deploy</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                        <configuration>
                            <appsDirectory>apps</appsDirectory>
                            <stripVersion>true</stripVersion>
                            <deployPackages>project</deployPackages>
                            <looseApplication>true</looseApplication>
                        </configuration>
                    </execution>
                    ...
                </executions>
                <configuration>
                   <installDirectory>/opt/ibm/wlp</installDirectory>
                   <serverName>test</serverName>
                </configuration>
            </plugin>
        </plugins>
    </build>
    ...
</project>