使用 Ant 构建多个 jar [英] Using Ant to build multiple jars

查看:32
本文介绍了使用 Ant 构建多个 jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个 Java eclipse 项目.他们每个人都有用于构建 jar 的jardesc"文件.很好 - 双击 -> 完成并制作 jar 文件.但是当我必须导出几个罐子时,这很痛苦——我必须多次重复这个过程.请告诉我,我可以使用 Ant 脚本一次运行多个jardesc"文件(并根据每个 jardesc 文件获取多个 jar)吗?怎么做?

I have multiple Java eclipse projects. Each of them has "jardesc" file for building jar. It's nice - double click -> finish and jar file is made. But when i have to export several jars it's a pain - i have to repeat procedure several times. Please tell me, can i use Ant script to run several "jardesc" files at once (and get several jars according to each jardesc file)? How to do it?

推荐答案

查看 ant 中的 subant 任务.您可以创建调用其他文件的 ant 文件.

Take a look at subant task in ant. You can create ant-file which would call other files to.

    <subant target="create_jar1">
        <fileset dir="." includes="jar2.xml"/>
    </subant>
    <subant target="create_jar2">
        <fileset dir="." includes="jar1.xml"/>
    </subant>

这篇关于使用 Ant 构建多个 jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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