tags:

views:

6512

answers:

2

I'm using eclipse to build an ear file using ant. I'm using oc4j, and I want to make sure that orion-application.xml is included in the build. What I'm currently using but does not work is:

   <target name="ear" depends="">
     <echo>Building the ear file</echo>
     <copy todir="${build.dir}/META-INF">
      <fileset dir="${conf.dir}" includes="orion-application.xml"/>
     </copy>
     <ear destfile="${dist.dir}/${ant.project.name}.ear" 
                appxml="${conf.dir}/application.xml">
      <fileset dir="${dist.dir}" includes="*.jar,*.war"/>
     </ear>
    </target>

What is the right way to add this to the ear?

+5  A: 

Ant EAR task

Everything that should go into META-INF folder should be specified via nested <metainf> fileset:

<ear destfile="${dist.dir}/${ant.project.name}.ear" 
  appxml="${conf.dir}/application.xml">
  <metainf dir="${build.dir/META-INF}"/>
  <fileset dir="${dist.dir}" includes="*.jar,*.war"/>
</ear>
ChssPly76
Worked great! I was having a bit of difficulty understanding the documentation.
Ant EAR task => http://ant.apache.org/manual/Tasks/ear.html
ian_scho
A: 

Gurus, I like your site. Keep it up!

Johnny