【问题标题】:Deploy a web-application on Websphere 8.5 using maven 3使用 maven 3 在 Websphere 8.5 上部署 Web 应用程序
【发布时间】:2015-01-28 13:28:32
【问题描述】:

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

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

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

感谢您的期待, 莫森

【问题讨论】:

  • 您可以从 IBM 获取 websphere 并在基于 Eclipse 的 IBM RAD 中制作 .ear。您可以从 Apache 站点获取 Maven。
  • 确保你有stackoverflow.com/a/8510172/7634099中提到的上下文根集

标签: websphere maven-3


【解决方案1】:

我从未使用过 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 答案中所述。

【讨论】:

  • 我只想指出 ${was61home} 不适用于 WebSphere 7,我必须定义一个自定义属性 was7Home,并为其分配正确的安装路径root 让这个插件为我工作。
【解决方案2】:

希望这会有所帮助:

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

    要打包 *.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 package。 因为你 pom.xml 中定义的包,ear 会被创建,并且可以在 YourApp/target 目录中找到。

    在 websphere 管理控制台上,您可以简单地安装 ear。 登录后,转到:

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

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

    yourServerName:9080/YourApp.
    

    祝你好运。

    【讨论】:

    • 谢谢。这正是我所寻找的。​​span>
    【解决方案4】:

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

    Websphere Maven 插件提供以下目标:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-04
      • 2015-03-17
      • 2013-02-15
      • 2013-08-01
      • 2015-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多