我有一个应用程序在 WebSphere liberty 中运行。通过 mvn 安装命令,我需要将我的应用程序部署到 liberty apps 目录,因为我没有使用 dropins 目录。
Bellow 是工作 maven 插件代码,我可以从中部署到 dropins 目录。
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>start-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<verifyTimeout>60</verifyTimeout>
</configuration>
</execution>
<execution>
<id>deploy</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverHome>${wlp.dir}</serverHome>
<serverName>${server}</serverName>
<appArtifact>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
</appArtifact>
<appDeployName>${project.artifactId}.${project.packaging}</appDeployName>
</configuration>
</plugin>
我在任何地方都找不到需要添加/更改的配置才能将应用程序直接部署到应用程序目录。有人可以让我知道这里缺少什么吗?
安装应用程序执行步骤而不是部署(部署执行步骤将仅将应用程序部署到dropins文件夹(步骤将解决此问题。版本必须更新到1.3,这是目前最新的版本
编号 : https://github.com/WASdev/ci.maven/blob/master/docs/install-apps.md
完整的 maven 插件代码将像下面一样
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>start-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<verifyTimeout>60</verifyTimeout>
</configuration>
</execution>
<execution>
<id>install-apps</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install-apps</goal>
</goals>
<configuration>
<appsDirectory>apps</appsDirectory>
<installAppPackages>project</installAppPackages>
</configuration>
</execution>
</executions>
<configuration>
<serverHome>${wlp.dir}</serverHome>
<serverName>${server}</serverName>
<appArtifact>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
</appArtifact>
<appDeployName>${project.artifactId}.${project.packaging}</appDeployName>
</configuration>
</plugin>
您也可以尝试该插件的当前 2.0-SNAPSHOT 版本。只需包括父 pom 和插件的一小段配置即可。2.0 版本将于 6 月初发布。
如果您不想包含父 pom,您只需从父 pom 复制 <pluginManagement/>
部分,其中包含 liberty-maven-plugin 目标与 Maven 默认构建生命周期的绑定。 见 https://github.com/WASdev/ci.maven/blob/master/docs/parent-pom.md
<parent>
<groupId>net.wasdev.wlp.maven.parent</groupId>
<artifactId>liberty-maven-app-parent</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/
</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/
</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
...
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
...
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<assemblyArtifact>
<groupId>com.ibm.websphere.appserver.runtime</groupId>
<artifactId>wlp-webProfile7</artifactId>
<version>17.0.0.1</version>
<type>zip</type>
</assemblyArtifact>
<serverName>${project.artifactId}Server</serverName>
<configFile>src/main/liberty/config/server.xml</configFile>
</configuration>
</plugin>
</plugins>
...
</build>