Maven构建未正确安装功能
问题描述:
当尝试使用passwordUtilities功能配置我的pom.xml文件时,messages.log似乎总是显示该功能在服务器启动期间未安装,即使它位于功能管理器列表中我可以在wlp/lib中看到所有需要的功能文件。这是我目前已经在pom.xml中编码:Maven构建未正确安装功能
<configuration>
<assemblyArtifact>
<groupId>com.ibm.websphere.appserver.runtime</groupId>
<artifactId>wlp-javaee7</artifactId>
<version>16.0.0.4</version>
<type>zip</type>
</assemblyArtifact>
<configFile>src/main/liberty/config/server.xml</configFile>
<include>${packaging.type}</include>
<bootstrapProperties>
<appContext>${warContext}</appContext>
<default.http.port>${testServerHttpPort}</default.http.port>
<default.https.port>${testServerHttpsPort}</default.https.port>
<appLocation>${project.artifactId}.war</appLocation>
</bootstrapProperties>
</configuration>
<executions>
<execution>
<id>install-feature</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install-feature</goal>
</goals>
<configuration>
<features>
<acceptLicense>true</acceptLicense>
<feature>passwordUtilities-1.0</feature>
</features>
</configuration>
</execution>
答
的install-feature
目标需要绑定到prepare-package
阶段,(根据the doc),而不是到pre-integration-test
阶段。
此外,我应该指出,如果您从您的<features>
配置中省略功能,那么server.xml将被扫描并且缺失的功能将自动下载。
因此新<exection>
节是这样的:
<execution>
<id>install-feature</id>
<phase>prepare-package</phase>
<goals>
<goal>install-feature</goal>
</goals>
<configuration>
<features>
<acceptLicense>true</acceptLicense>
</features>
</configuration>
</execution>
答
安迪,这是正确的。我们在install-feature
文档中修复了一个误导性示例:https://github.com/WASdev/ci.maven/blob/master/docs/install-feature.md#install-feature。
很酷,我通过了messages.log中的passwordUtilities not installed消息。 –