maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdiddly <rdo...@mac.com>
Subject Using Maven to produce an EAR
Date Tue, 11 Jun 2013 20:26:54 GMT
Hello Maven mavens,

Forgive me if this is a duplicate. I sent it by email, but didn't see it
show up on the Nabble site, so I don't know if sending it to the list via
email works or not.

Good documentation on the maven ear plugin is not easy to find. Most posts
are from 2005.

I've got a multi-module POM. It has 6 sub-modules:

client.war
client-ejb.jar
admin.war
common-ejb.jar
app.ear
command.jar

I want to build client.war, client-ejb.jar, admin.war, and common-ejb.jar
into bundle.ear. common-ejb.jar has a compile time dependency on
thirdparty.jar (which is in my local repository). (command.jar is a
command-line java utility class that's used to execute jobs from a remote
client.)

I can build all of the sub-modules without any problems. Here's my pom to
build the ear (missing the open/close tags from XML, using ':' to separate
opening tag from content):

project
  modelVersion:4.0.0/modelVersion
  parent
    groupId:com.company/groupId
    artifactId:jewels/artifactId
    version:1.0-SNAPSHOT/version
  /parent
  groupId:com.company/groupId
  artifactId:bundle/artifactId
  version:1.0-SNAPSHOT/version
  packaging:ear/packaging
  
  name:bundle/name

  properties
    project.build.sourceEncoding:UTF-8/project.build.sourceEncoding
  /properties
  
  dependencies
    dependency
      groupId:com.company/groupId
      artifactId:client/artifactId
      version:1.0-SNAPSHOT/version
      type:war/type
    /dependency
    dependency
      groupId:com.company/groupId
      artifactId:client-ejb/artifactId
      version:1.0-SNAPSHOT/version
      type:ejb/type
    /dependency
    dependency
      groupId:com.company/groupId
      artifactId:admin/artifactId
      version:1.0-SNAPSHOT/version
      type:war/type
    /dependency
    dependency
      groupId:com.company/groupId
      artifactId:common-ejb/artifactId
      version:1.0-SNAPSHOT/version
      type:ejb/type
    /dependency
  /dependencies

  build
    plugins
      plugin
        groupId:org.apache.maven.plugins/groupId
        artifactId:maven-ear-plugin/artifactId
        version:2.8/version
        configuration
          modules
            jarModule
              groupId:third.party/groupId
              artifactId:thirdparty/artifactId
              bundleDir:lib/bundleDir
            /jarModule
          /modules
        /configuration
      /plugin
    /plugins
  /build
/project


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.

I'm sure I'm doing something wrong, but it's hard to tell what given the
dearth of good examples.

Can anyone lend some assistance?

Thanks,
Richard

P.S. I'm in the very early stages of trying to move this project from Ant to
Maven. If there's anything about what you see here that you think I should
be doing differently (not that I've given the whole story, but from this
excerpt), please don't hesitate to let me know.



--
View this message in context: http://maven.40175.n5.nabble.com/Using-Maven-to-produce-an-EAR-tp5759041.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message