Liberty:Maven 目标 - liberty:install-apps
可以使用 liberty:install-apps 目标将一个或多个应用程序复制到 Liberty 服务器。
liberty:install-apps 目标将指定为 Maven 依赖项的应用程序复制到 Liberty 服务器的 dropins/ 目录中。只有 compile 作用域中的 Maven 依赖项才会复制到该服务器。该服务器必须存在并且不得正在运行。可以将 liberty:install-apps 目标与 liberty:package-server 目标进行组合,以使用预安装的应用程序来创建 Liberty 服务器归档。
参数
下表描述了 install-apps 目标的参数。
参数 | 描述 | 必需 |
---|---|---|
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。 | 否 |
- 示例:安装应用程序
- 这是可以用在项目的 pom.xml 文件中的代码段。
<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>