You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James CE Johnson <jc...@tragus.org> on 2003/10/29 22:54:46 UTC

Making a massive earfile...

I'm looking for some advice on the best way to make a single massive ear
file for the app I'm building.

Currently, my project consists of:
- one jar of plain old objects
- two jars of EJBs
- one war of the webapp bits

Each of these four things are subprojects within my larger project.

I want to give our production team a single ear file that contains
everything needing to be deployed. To do that I can easily create a
project.xml that references each of the above and use ear:ear to bundle up
the result. But... That ear file needs to also include the rather large
list of "third party" jars required by the code I've written. All of those
are already listed in each subprojects' project.xml. Is there a clever way
to construct bigEar/project.xml so that I don't have to copy/paste the
list of dependencies from each of the subprojects?

My current solution looks something like this:

  <goal name="earfile">

    <copy file="conf/application.xml"
          todir="${maven.build.dir}"
          filtering="true"
          />
    <copy file="conf/jboss-app.xml"
          todir="${maven.build.dir}">
      <filterset>
        <filter token="APPLICATION_EARFILE"
                value="${maven.final.name}.ear"/>
      </filterset>
    </copy>

    <deploy:copy-deps todir="${maven.build.dir}"
            projectDescriptor="${basedir}/../security/project.xml"/>
    <deploy:copy-deps todir="${maven.build.dir}"
            projectDescriptor="${basedir}/../service/project.xml"/>
    <deploy:copy-deps todir="${maven.build.dir}"
            projectDescriptor="${basedir}/../view/project.xml"/>

    <ear earfile="${maven.build.dir}/${maven.final.name}.ear"
         appxml="${maven.build.dir}/application.xml">

      <fileset dir="${maven.build.dir}"
               includes="*.jar,*.war" />

      <metainf dir="${maven.build.dir}"
               includes="jboss-app.xml" />
    </ear>

  </goal>


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