0
votes

I've been using the EAR plugin to package a WAR, EJB & RAR module, however, while they all package successfully when i run mvn clean package, I notice the following gets output in the target directory.

  • application.xml (generated application.xml)
  • my-application-ear-1.0-SNAPSHOT (directory with correctly packaged WAR, EJB & RAR dependencies, META-INF with generated application.xml and additional resources from the EAR project)
  • my-application-ear-1.0-SNAPSHOT.ear (9kb .ear file that only has the META-INF with the generated application.xml & additional resources from the EAR project)

None of the modules are packaged in the final EAR file.

Here is the <build> node of the EAR project's POM.

<build>

<plugins>
  <plugin>
    <artifactId>maven-ear-plugin</artifactId>
    <version>3.0.2</version>
    <configuration>
      <finalName>my-application-ear</finalName>
      <version>7</version>
      <earSourceDirectory>src/main/application</earSourceDirectory>
      <packagingIncludes>**/*</packagingIncludes>
      <defaultLibBundleDir>lib</defaultLibBundleDir>
      <filtering>false</filtering>
      <packagingIncludes>Default_HTTP_WC/**,Default_IIOP_WC/**,Default_JMS_WC/**,META-INF/**,</packagingIncludes>
      <modules>
        <ejbModule>
          <groupId>com.abc.def</groupId>
          <artifactId>ejb-module</artifactId>
          <bundleDir>/</bundleDir>
          <bundleFileName>ejbModule.jar</bundleFileName>
          <moduleId>EjbModule_1</moduleId>
        </ejbModule>

        <rarModule>
          <groupId>com.abc.def</groupId>
          <artifactId>rar-module</artifactId>
          <bundleDir>/</bundleDir>
          <bundleFileName>RARModule</bundleFileName>
          <uri>/RARModule.rar</uri>
          <unpack>true</unpack>
          <moduleId>RARModule_1</moduleId>
        </rarModule>


          <webModule>
              <groupId>com.abc.def</groupId>
              <artifactId>my-web-app</artifactId>
              <uri>/WebApplication.war</uri>
            <bundleDir>/</bundleDir>
              <bundleFileName>WebApplication.war</bundleFileName>
              <contextRoot>/foo</contextRoot>
              <moduleId>WebModule_1</moduleId>
          </webModule>


      </modules>
    </configuration>
    <goals>
      <goal>ear</goal>
    </goals>
  </plugin>

</plugins>

Am i missing something? Any assistance is appreciated.

1

1 Answers

0
votes

I figured out my problem, I had completely overlooked the use of <packagingIncludes> from an earlier iteration. removed it and its fine.