蚂蚁依赖管理 [英] Ant dependency management

查看:119
本文介绍了蚂蚁依赖管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好像蚂蚁依赖管理也不是很大,至少可以说......但是,有希望吗?
今天,有用于建设或项目管理更好的选择,如Maven的,常春藤,但我坚持了一堆蚂蚁项目依赖于彼此,所以我在想,如果有一个蚂蚁最佳实践管理依赖关系。

It seems that ant dependency management isn't great to say the least... But, is there hope? Today there are better choices for build or project management such as maven, ivy but I'm stuck with a bunch of ant project that depend on one another so I was wondering if there's an "ant best practice" for managing dependencies.

具体到我的情况,我有:

Specifically in my case I have:

w.war

a.jar
b.jar
c.jar

w.war是war文件我部署到Web服务器。 WAR文件中我使用a.jar文件。 a.jar文件取决于b.jar,所以我愉快地打包成b.jarW¯¯以及...这是直到排序行...
当b.jar取决于c.jar问题开始。 a.jar文件的作者知道其上b.jar依赖,以便它可以包b.jar成w.war,但它并不知道b.jar对c.jar的依赖。此外,如b.jar取决于e.jarb.jar的作者以后可以添加更多的依赖关系,因此a.jar文件的作者没有机会下列这些依赖,因为他们加起来。

w.war is the war file I deploy to the web server. In the war file I use a.jar. a.jar depends on b.jar, so I happily package b.jar into w as well... That's sort of OK until... The problem starts when b.jar depends on c.jar. The author of a.jar knows about its dependency on b.jar so it can package b.jar into w.war, but it is not aware of the dependency of b.jar on c.jar. Moreover, the author of b.jar could later add even more dependencies such as "b.jar depends on e.jar", so the author of a.jar has no chance following these dependencies as they add up.

我想有定义是一个依赖于B和B依赖于C(在不同的build.xml文件),并使用ant魔法将它们全部汇编成w.war。
那可能吗?如果没有,是否有一个最佳做法?

What I'd like to have is define "a depends on b" and "b depends on c" (in a different build.xml file) and use ant magic to compile them all into w.war. Is that possible? If not, is there a Best-Practice?

我是这个闭只重写全部在Maven的,但它是一个大量的工作...有希望蚂蚁?

I'm this-close to just rewriting is all in maven, but it's a lot of work... Is there hope to ant?

推荐答案

如果您已经使用Ant,那么你最好的选择是使用常春藤的依赖管理。

If you already use Ant, then your best bet is to use Ivy for dependency management.

http://ant.apache.org/ivy/

它提供了一套丰富的蚂蚁任务依赖操纵。

It provides a rich set of ant tasks for dependency manipulation.

这篇关于蚂蚁依赖管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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