Liberty:Maven 目标 - liberty:deploy

可以使用 liberty:deploy 目标将应用程序部署到 Liberty 服务器。

liberty:deploy 目标将所指定的应用程序部署到 Liberty 服务器的 dropins/ 目录中。该服务器必须存在并且必须正在运行。

参数

下表描述了 deploy 目标的参数。

表 1. deploy 目标的参数.

第一列包含参数列表,第二列包含对每个参数的描述,第三列指出此参数是否为必需参数。

参数 描述 必需
serverHome Liberty 服务器安装的目录位置。 是,仅当未设置 assemblyArchive 和 assemblyArtifact 参数时才必须设置此参数。
assemblyArchive Liberty 服务器压缩归档所在的位置。此归档将解包到由 installDirectory 参数所指定的目录中。 是,仅当未设置 serverHome 和 assemblyArtifact 参数时才必须设置此参数。
assemblyArtifact Liberty 服务器组合件的 Maven 工件名称。该组合件将安装到由 installDirectory 参数所指定的目录中。有关 Liberty 服务器 Maven 组合件的更多信息,请参阅Liberty:作为 Maven 工件进行安装。 是,仅当未设置 serverHome 和 assemblyArchive 参数时才必须设置此参数。
installDirectory 使用组合件归档或工件选项来安装 Liberty 服务器时,该服务器的本地安装目录位置。缺省值为 ${project.build.directory} /liberty。 否
refresh 如果值为 true,那么会将 Liberty 服务器重新安装到本地目录中。仅当使用组合件归档或工件选项来安装此服务器时才使用此参数。缺省值为 false。 否
serverName Liberty 服务器实例的名称。缺省值为 defaultServer。 否
appArchive 要部署的应用程序文件所在的位置。应用程序类型可为 war、ear、rar、eba、zip 或 jar。 是,如果未设置 appArtifact 参数。
appArtifact 要部署的应用程序的 Maven 工件名称。应用程序类型可为 war、ear、rar、eba、zip 或 jar。自 liberty-maven-plugin V1.1 开始。 是,如果未设置 appArchive 参数。
timeout 验证是否已成功完成部署时的最长等待时间(以毫秒计)。缺省值为 40 秒。 否
示例:部署应用程序
这是可以用在项目的 pom.xml 文件中的代码段。
<build>
    ...
    <plugins>
        <plugin>
            <groupId>com.ibm.websphere.wlp.maven.plugins</groupId>
            	<artifactId>liberty-maven-plugin</artifactId>
            	<version>1.0</version>
            	<executions>
                ...
                <execution>
                    <id>deploy-app</id>
                    			<phase>pre-integration-test</phase>
                    			<goals>
                        <goal>deploy</goal>
                    			</goals>
                    <configuration>
                        <appArchive>HelloWorld.war</appArchive>                        
                    </configuration>
                		</execution>
                ...
            </executions>
            <configuration>
                <serverHome>/opt/ibm/wlp</serverHome>
                <serverName>test</serverName>
            </configuration>
        </plugin>
    </plugins>
    ...
</build>
示例:从命令行部署应用程序
以下是一个 Maven 命令,可以用来将应用程序部署到服务器。
mvn liberty:deploy -DserverHome=/opt/ibm/wlp -DserverName=test
                   -DappArchive=/tmp/HelloWorld.war

用于指示主题类型的图标 参考主题



时间戳记图标 最近一次更新时间: Friday, 16 September 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-dist&topic=rwlp_maven_deploy
文件名:rwlp_maven_deploy.html