适用于多个应用程序服务器的Maven EAR项目

时间:2014-03-05 20:16:45

标签: maven java-ee jboss websphere ear

我有一个EAR项目,我想要使用专门的maven自动化构建过程。

EAR项目

  • 标准jar模块
  • 网络模块
  • EJB模块
  • RAR模块

为了能够在Jboss 4.2.3和WebSphere 7中执行产品,必须以不同的方式配置EJB和RAR描述符。此外,我们为每个应用服务器都有一个jar库。

我想要的是能够使用相同的项目为每个应用服务器构建一个EAR,为此我需要

  1. 根据应用服务器包含JAR模块
  2. 根据使用EJB / RAR模块中的自定义描述符 应用服务器
  3. 将所有这些自定义模块打包到EAR中
  4. 可以使用maven中的同一组项目来完成吗?

2 个答案:

答案 0 :(得分:3)

不确定。看看maven中的profiles。它们允许您调整各种事物(来自链接),如:

  • <repositories>
  • <pluginRepositories>
  • <dependencies>
  • <plugins>
  • <properties>(实际上并非在主POM中可用,但在幕后使用)
  • <modules>
  • <reporting>
  • <dependencyManagement>
  • <distributionManagement>
  • 元素的子集,包括:
    • <defaultGoal>
    • <resources>
    • <testResources>
    • <finalName>

答案 1 :(得分:0)

最好是创建单独的模块,如ear-websphere或ear-jboss,并制作一个合适的pom文件,其中包含maven-ear-plugin所需的配置。

相关问题