3

In our code base we have a dependency on the ant version used in eclipse.

In the the ant.jar has been set up as a library which the project uses

This is a pain when moving versions of eclipse as the Ant plugin folder name changes (although I see it is now just called Ant1.7)

Is there a way to access eclipses reference to ANT Home which appears in the workspace preferences so that I don't have to explicitly set a variable that has the hard coded path to the ant plugins folder

4

5 回答 5

1

首先,您的项目不应该依赖于 eclipse 的 Ant 版本,您应该保留自己的版本,以便将您的项目与 eclipse 解耦。如果开发人员或您自己决定使用 IntelliJ 怎么办?

虽然我不知道你的项目的性质是什么,但我认为所有依赖项都应该添加到你的项目 lib 目录或类似的东西中。

于 2008-11-27T00:37:19.790 回答
0

您的蚂蚁之家位于 ${ant.home} 属性中

例如:

<echo> ${ant.home} </echo>

在我的机器上提供以下内容:

 [echo]  D:\java\eclipse_3.4_jee\plugins\org.apache.ant_1.7.0.v200803061910 

于 2008-11-26T22:49:23.580 回答
0

One possible suggestion would be to :

  • transform your project into a plugin project (properties on your project / PDE tools / convert Project to Plug-in Projects...) and
  • add to its dependencies the 'ant' required plugin.

That would be easier to manage when you change the version of eclipse.

于 2008-11-06T12:27:27.343 回答
0

您是否考虑过单独安装 Ant,创建环境变量,然后通过 Ant build.xml 中的 ANT_HOME 环境变量引用该位置?

于 2008-11-24T04:46:00.973 回答
0

在 Eclipse 中,在包资源管理器视图中,右键单击特定项目并构建路径。

移动到库选项卡并选择“添加变量...”按钮。从这里你会看到 JDK 系统库路径,maven(如果你正在使用它,tomcat,eetc...) 如果 ANT_HOME 没有出现,你可以通过单击配置变量来添加它...按钮。从这一刻起,ANT_HOME 路径将被考虑在项目的构建路径中。

希望能帮助到你。

卡洛斯

于 2008-11-26T08:56:08.817 回答