maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <ljnel...@gmail.com>
Subject Re: Using Maven to produce an EAR
Date Tue, 11 Jun 2013 21:39:31 GMT
On Tue, Jun 11, 2013 at 1:26 PM, rdiddly <rdoust@mac.com> wrote:

> I found that if I didn't use the jarModule in the configuration,
> thirdparty.jar was put into the root directory of the ear instead of in the
> lib folder (which is where I believe I want it), so I added the jarModule
> block to specify that the thirdparty.jar should be put in the lib
> directory.
> It is now put in the lib directory. Great. But, it's also in the root
> directory.
>

You're probably missing the defaultLibBundleDir configuration option,
documented here:
http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html#defaultLibBundleDir

Here's more or less what you want:

<dependencies>
  <dependency>
    <groupId>whatever</groupId>
    <artifactId>someWar</artifactId>
    <version>someVersion</version>
    <type>war</type>
  </dependency>

  <dependency>
    <groupId>whatever</groupId>
    <artifactId>someEJB</artifactId>
    <version>someVersion</version>
    <type>ejb</type>
  </dependency>

  <dependency>
    <groupId>whatever</groupId>
    <artifactId>*someOrdinaryJar*</artifactId>
    <version>someVersion</version>
*    <!-- look, ma, no type element -->*
  </dependency>
</dependencies>

<build>
  <plugins>
    <plugin>
      <artifactId>maven-ear-plugin</artifactId>
      <configuration>
*        <defaultLibBundleDir>lib</defaultLibBundleDir>*
        *<version>6</version>* <!-- Java EE version; I presume you want 6
-->
      </configuration>
    </plugin>
  </plugins>
</build>

No modules necessary (at this level of configuration); no other
configuration.

Of note: the version parameter defaults to something godawful like 1.3,
which is why you have to specify it here.

The defaultLibBundleDir has no default, so you have to specify "lib".  I
regard both of these things as bugs.

Hope that helps you out.

Best,
Laird

-- 
http://about.me/lairdnelson

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message