Maven 3.3 支持 Websphere 8.5.5 - pom.xml

maven 3.3 support for Websphere 8.5.5 - pom.xml

我找不到使用 Maven 的 pom.xml 在 websphere 8.5.5 中部署我的 war 文件的方法。 我看到有一个名为 was6-maven-plugin-1.2.1 的插件。它似乎也可以支持 WAS 6+、7+、8+。

但我无法使用此插件部署 war 文件。它抛出以下错误。

[ERROR] Failed to execute goal org.codehaus.mojo:was6-maven-plugin:1.2.1:installApp (default-cli) on project TEST: Bad archive: C:\test.war -> [Help 1]

请评论...

我的 pom.xml 配置 FYR:

            <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>was6-maven-plugin</artifactId>
          <version>1.2.1</version>
          <executions>
            <execution>
              <id>integration-test</id>
              <phase>integration-test</phase>
              <goals>
                <goal>installApp</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <wasHome>C:\Program Files (x86)\IBM\WebSphere\AppServer</wasHome>
            <host>127.0.0.1</host>
            <server>server1</server>
            <node>localhostNode01</node>
            <virtualHost>default_host</virtualHost>
            <verbose>true</verbose>
            <conntype>SOAP</conntype>
            <port>8880</port>
            <earFile>test.war</earFile>
            <verbose>true</verbose>
            <updateExisting>true</updateExisting>
            <applicationName>${project.build.finalName}</applicationName>                           
          </configuration>
        </plugin>

要使用 Maven 开发 WebSphere 项目,请按照此文档Setting up your environment for Maven配置环境。

特别是对于 WAS 8.5.5,您应该在 pom.xml 中使用以下条目:

<dependency>
      <groupId>com.ibm.tools.target</groupId>
      <artifactId>was</artifactId>
      <version>8.5.5</version>
      <type>pom</type>
      <scope>provided</scope>
</dependency>

对于此 POM 目标,您需要使用将运行时库复制到本地 Maven 存储库的启动配置脚本。

有关如何复制这些库的详细说明,请参阅 Configuring dependency POM files that emulate the classpath of specific WebSphere runtime environments