使用maven 3在Websphere 8.5上部署Web应用程序

时间:2013-02-11 09:01:37

标签: websphere maven-3

我正在尝试使用JSF从现有的Web应用程序创建Maven项目。该项目 应该部署在Web Sphere 8.5上。

由于我是Web Sphere的新手,因此不知道如何构建“ear”模块,以便可以在Web Sphere 8.5上进行部署。

有谁知道,在哪里可以找到有关使用Maven 3.0.3在Web Sphere 8.5上部署Web应用程序的更多信息?

期待感谢你, 摩森

4 个答案:

答案 0 :(得分:4)

为了打包* .ear,您不需要Websphere。 这可以通过maven本身完成。

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>

然后添加依赖项。 在命令行上转到您的项目并运行mvn包。 由于您在pom.xml中定义了包,因此将创建耳朵,并且可以在YourApp / target目录中找到。

在websphere管理控制台上,您只需安装耳塞即可。 登录后,转到:

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

选择YourApp.ear并通过快速路径轻松安装应用。 要检查的端口可能是

yourServerName:9080/YourApp.
祝你好运。

答案 1 :(得分:4)

我从未使用过WebSphere Application Server 8.5;但在我使用IBM WAS 6.1的那些日子里,WAS6 Maven plugin工作得非常好(似乎it works with WAS7 too)。这是来自插件站点的POM片段,允许自动进行EAR部署:

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

该插件用于部署和其他管理任务,对于EAR生成,您可以使用Maven EAR Plugin,如20InchMovement答案中所述。

答案 2 :(得分:3)

希望这会有所帮助:

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

来自https://github.com/orctom/was-maven-plugin

答案 3 :(得分:1)

请参阅http://code.google.com/p/websphere-maven-plugin/

Websphere Maven插件提供以下目标:

在websphere 7上部署ear 开始申请 停止申请 卸载 需要websphere应用程序客户端。

相关问题