Mosen
Mosen

Reputation: 101

Deploy a web-application on Websphere 8.5 using maven 3

I´m trying to make a Maven Project from an existing web application using JSF. The Project should be deployed on Web Sphere 8.5.

Since i'm new to Web Sphere, don´t know how to build the "ear" Module, in order to be deployable on Web Sphere 8.5.

Does anyone know, where i can find further Information about deploying a web application on Web Sphere 8.5 using Maven 3.0.3?

Thanking you in anticipation, Mosen

Upvotes: 10

Views: 25870

Answers (4)

Hao
Hao

Reputation: 131

Hope this could helps:

<plugin>
    <groupId>com.orctom.mojo</groupId>
    <artifactId>was-maven-plugin</artifactId>
    <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

Upvotes: 4

chicco
chicco

Reputation: 29

See http://code.google.com/p/websphere-maven-plugin/

Websphere Maven Plugin provides goals to:

deploy ear on websphere 7 start application stop application uninstall require websphere application client.

Upvotes: 0

Carlos Gavidia-Calderon
Carlos Gavidia-Calderon

Reputation: 7243

I've never worked with WebSphere Application Server 8.5; but in the days I was playing with IBM WAS 6.1 the WAS6 Maven plugin worked pretty well (it seems it works with WAS7 too). Here's a POM fragment from the plugin site that allows automatic EAR deployment:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>was6-maven-plugin</artifactId>
  <version>1.2</version>
  <executions>
    <execution>
      <id>integration-test</id>
      <phase>integration-test</phase>
      <goals>
        <goal>installApp</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <wasHome>${was61home}</wasHome>
    <host>deploymentmanager.your.domain</host>
    <username>admin</username>
    <password>adminpassword</password>
    <targetCluster>nameOfCluster</targetCluster>
    <profileName>Dmgr01</profileName>
    <conntype>SOAP</conntype>
    <port>8879</port>
    <verbose>true</verbose>
    <updateExisting>false</updateExisting>
  </configuration>
</plugin>

That plugin is for deployment and other administrative task, for EAR generation you can use the Maven EAR Plugin as described in 20InchMovement answer.

Upvotes: 4

20InchMovement
20InchMovement

Reputation: 102

in order to package an *.ear, you don't need Websphere. This can be accomplished with maven itself.

pom.xml:
<project>
...
<artifactId>YourApp</
<packaging>ear</packaging>
...
<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <configuration>
                    <modules>
                        <jarModule>
                            <groupId>${project.parent.groupId}</groupId>
                            <artifactId>configurationApp</artifactId>
                        </jarModule>
                        <ejbModule>
                            <groupId>${project.parent.groupId}</groupId>
                            <artifactId>AnEjbModule</artifactId>
                        </ejbModule>
                    </modules>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
...
</project>

Then you add your dependencies. On command line go to your project and run mvn package. Because of the package defined in you pom.xml, the ear will be created and can be found in the YourApp/target directory.

On the websphere admin console you can simply install the ear. After login, goto:

Applications->Websphere enterprise applications and install a new application.

Select your YourApp.ear and go for easiness through the fast path to install the app. The port to check is probably

yourServerName:9080/YourApp.

Good luck.

Upvotes: 3

Related Questions