如何使用包含某些文件的 ant 构建创建 EAR 文件? [英] How do I create an EAR file with an ant build including certain files?

查看:32
本文介绍了如何使用包含某些文件的 ant 构建创建 EAR 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 eclipse 使用 ant 构建一个 ear 文件.我正在使用 oc4j,并且我想确保构建中包含 orion-application.xml.我目前正在使用但不起作用的是:

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?

推荐答案

Ant EAR 任务

应该通过嵌套的 文件集指定应该进入 META-INF 文件夹的所有内容:

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>

这篇关于如何使用包含某些文件的 ant 构建创建 EAR 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆