如何覆盖存储在蚂蚁lib目录Ant任务 [英] How to override ant task stored in ant lib directory

查看:156
本文介绍了如何覆盖存储在蚂蚁lib目录Ant任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的工作中,我们使用的AspectJ在我们的一些Java项目中。为了得到这个与蚂蚁的工作建立,我们一直把aspectjtools.jar蚂蚁/ lib目录/.

我现在工作的一个特定的Java项目,需要使用AspectJ的新版本。我不希望要得到大家谁使用项目来更新其本地aspectjtools.jar的副本。相反,我尝试添加更新的aspectjtools.jar到项目的lib目录下,添加以下行到build.xml。

 <的taskdef
     资源=组织/ AspectJ的/工具/蚂蚁/任务定义/ aspectjTaskdefs.properties
     CLASSPATH =./的lib / aspectjtools.jar/>

不过,正如我希望的那样蚂蚁类加载器加载罐从蚂蚁/ lib中/在preference来我在的taskdef classpath中指定JAR这是行不通的。

有没有办法强迫蚂蚁挑罐子签入我的项目呢?


解决方案

我的问题的最终答案是否定的。在目前没有办法为ANT在preference在Ant lib目录中使用的jar任务,从项目到任务罐子。

At my work we use AspectJ in some of our Java projects. To get this to work with ant builds we have been placing aspectjtools.jar within ant/lib/.

I am now working on a particular Java project and need to use a newer version of aspectJ. I don't want to have to get everyone who uses the project to update their local copy of aspectjtools.jar. Instead, I tried adding the newer aspectjtools.jar to the lib directory of the project and adding the following line to build.xml.

  <taskdef
     resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"
     classpath="./lib/aspectjtools.jar" />

However, this doesn't work as I hoped as the ANT classloader loads jars from ant/lib/ in preference to the jar I specify in the taskdef classpath.

Is there any way to force ant to pick the jar checked into my project instead?

解决方案

The ultimate answer to my question is no. The is currently no way for ANT to use a task jar from a project in preference to a task jar in the ANT lib directory.

这篇关于如何覆盖存储在蚂蚁lib目录Ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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