Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote Deploy to WebSphere 8.5 using maven

I would like to control a remote deployment of a maven generated EAR over to an existing WAS instance not running on the build server.

Ideally, I would like to do this within Maven so that I can remote deploy in say the integration-test phase then proceed to run some JMeters in the verify phase. I guess this is pretty standard.

I have looked around and am unable to find a sensible way to do this in WAS 8.5.

There are a few posts:

Remote Deployment to WAS 6.1

websphere7am-maven-plugin

Cargo

and others around the web, including IBM. None seem to offer a way to achieve a remote deploy to WAS 8.5

Does anybody have a solution?

EDIT 1: Further confirmation from IBM that no official maven solution exists can be found here:

WAS 8.5 - Using Ant to automate tasks

like image 727
theINtoy Avatar asked Oct 25 '13 15:10

theINtoy


People also ask

How do I run a Maven project in WebSphere?

Select Run As -> Maven build...Click Apply. Click Run. The console file messages indicate that the installation of PA_portletapp-portlet application was successful. Verify that the PA_portletapp-portlet application was successfully deployed to the WebSphere Application Server and the WebSphere Portal Server.

Can maven be used for deployment?

The deploy plugin is primarily used during the deploy phase, to add your artifact(s) to a remote repository for sharing with other developers and projects. This is usually done in an integration or release environment.


2 Answers

AFAIK there is no Maven plugin for full-fledged WAS 8.5, only for WAS Liberty Profile. But that one does not support deployment to remote server.

Remote deployment can be done using WsAdmin Ant Task & Maven AntRun Plugin

like image 79
ᄂ ᄀ Avatar answered Sep 29 '22 17:09

ᄂ ᄀ


<plugin>
    <groupId>com.orctom.mojo</groupId>
    <artifactId>was-maven-plugin</artifactId>e
    <version>1.0.8</version>
    <executions>
        <execution>
            <id>deploy</id>
            <phase>install</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
            <configuration>
                <wasHome>${env.WAS_HOME}</wasHome>
                <applicationName>${project.build.finalName}</applicationName>
                <host>${local or remote address}</host>
                <server>server01</server>
                <node>node01</node>
                <virtualHost>default_host</virtualHost>
                <verbose>true</verbose>
            </configuration>
        </execution>
    </executions>
</plugin>

From https://github.com/orctom/was-maven-plugin

Updated on 5/29/2014

Developer of this plugin states on github, "1.0.1 and 1.0.2 is not working, please don't use them!", so I've updated this answer to show version 1.0.3.

Updated on 1/27/2015

Updated to '1.0.8'.

like image 30
Hao Avatar answered Sep 29 '22 17:09

Hao