Search code examples
javamavenwebspherepom.xmlwebsphere-8

maven 3.3 support for Websphere 8.5.5 - pom.xml


I could not find a way to deploy my war file in websphere 8.5.5 using maven's pom.xml. I see there is a plugin called was6-maven-plugin-1.2.1. and it can support WAS 6+, 7+, 8+ as well it seems.

But i could not deploy a war file using this plugin. It throws the following error.

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

Please comment on...

My pom.xml configuration 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>

Solution

  • For developing project for WebSphere using Maven, follow this document Setting up your environment for Maven to configure environment.

    Especially for WAS 8.5.5 you should use the following entry in pom.xml:

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

    For this POM target, you are required to use launch configuration scripts that copy runtime libraries to the local Maven repository.

    See the Configuring dependency POM files that emulate the classpath of specific WebSphere runtime environments for detailed instructions how to copy these libraries.