简体   繁体   English

Maven构建没有正确安装功能

[英]Maven build is not getting feature installed properly

When trying to configure my pom.xml file with the passwordUtilities feature, messages.log always seems to show that the feature is not installed during server startup, even though it's in the feature manager list and I can see all the required feature files in wlp/lib. 尝试使用passwordUtilities功能配置我的pom.xml文件时,messages.log似乎总是显示在服务器启动期间未安装该功能,即使它位于功能管理器列表中,我可以在wlp中看到所有必需的功能文件/ lib目录下。 This is what I currently have coded in pom.xml: 这是我目前在pom.xml中编码的内容:

<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>

The install-feature goal needs to be bound to the prepare-package phase, (according to the doc ) as opposed to the pre-integration-test phase. install-feature目标需要绑定到prepare-package阶段(根据文档 ),而不是pre-integration-test阶段。

Also, I should point out that if you omit features from your <features> configuration, then the server.xml will be scanned and missing features will be automatically downloaded. 此外,我应该指出,如果省略<features>配置中的<features> ,则将扫描server.xml并自动下载缺少的功能。

So your new <exection> stanza would look like this: 所以你的新<exection>节将如下所示:

<execution>
    <id>install-feature</id>
    <phase>prepare-package</phase>
    <goals>
        <goal>install-feature</goal>
    </goals>
    <configuration>
        <features>
            <acceptLicense>true</acceptLicense>
        </features>
    </configuration>
</execution>

Andy, That's correct. 安迪,这是对的。 We have fixed a misleading example in the install-feature documentation: https://github.com/WASdev/ci.maven/blob/master/docs/install-feature.md#install-feature . 我们在install-feature文档中修复了一个误导性的示例: https//github.com/WASdev/ci.maven/blob/master/docs/install-feature.md#install-feature

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM