添加用户库Ant构建器类路径 [英] Add user libraries to Ant Builder classpath

查看:133
本文介绍了添加用户库Ant构建器类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的Eclipse项目设立一个Ant生成器有问题。

I am having a problem with setting up an Ant Builder for my Eclipse projects.

我有几个配置为在Eclipse用户库的第三方库。这些库添加到我的项目的构建路径,一切工作正常。

I do have several 3rd party libs configured as user libraries within Eclipse. Those libraries are added to the build path of my projects and everything is working fine.

我的问题是,如果我想从Eclipse中使用Ant生成器,我将有一些用户库添加到Ant构建器的classpath得到它的工作。我需要那些利布斯因为它们包含多个任务DEFS和类型DEFS为Ant,而不是编译我的项目。但我怎么能添加这些用户库的Ant构建器类路径?我不想硬code他们通过手动添加它们,因为如果我必须在未来改变其中的一个库,我也必须维护所有蚂蚁建设者。我dont't知道如何加载在确定在Ant运行的路径,用户库动态加载它们,因为我需要在蚂蚁的引导那些库,以便能够成功地定义我需要的Ant任务。

My problem is, that if I want to use the Ant Builder from Eclipse, I will have to add some of the user libraries to the classpath of the Ant Builder to get it working. I need those Libs because they include several task defs and type defs for Ant, NOT TO COMPILE MY PROJECTS. But how can I add those user libraries to the Ant Builder classpath? I don't want to "hard-code" them by adding them manually, because if I must change one those libs in the future, I will also have to maintain all Ant Builders. And I dont't know how load determine the path to the user libraries at runtime within Ant to load them dynamically, because I need those libs at the bootstrap of Ant to be able to define my needed Ant Tasks successfully.

推荐答案

在这种情况下,你可能希望你的JAR文件(包含任务定义)添加到Ant的运行时间。

In that case, you may wish to add your JAR files (containing the taskdefs) to the Ant runtime.

窗口 - > preferences,选择 - 从左边的蚂蚁>运行。专注于全球条目,然后使用添加JAR按钮,在右侧添加JAR文件。

Window -> Preferences, select "Ant -> Runtime" from the left. Focus on "Global Entries", then use the "Add JAR" button on the right to add JAR files.

您添加的JAR文件将在Eclipse下运行的所有进程蚂蚁出资。

The JAR files you add will be contributed to any Ant process running under Eclipse.

您的下一个问题可能是 - 为什么我要补充的JAR我不能添加我的用户库?。问的好,很高兴你(几乎快要)问。驱使我疯狂过,我不知道为什么Eclipse不提供此功能。也许是时候打开一个功能的请求......

Your next question might be - "why do I have to add JARs? Can't I add my user library?". Good question, glad you (were almost about to) asked. Drives me bonkers too and I have no idea why Eclipse doesn't provide this functionality. Maybe it's time to open a feature request...

修改 2014年2月:原来,添加用户库Ant的类路径已经要求(的 https://bugs.eclipse.org/bugs/show_bug.cgi?id=211669 )。由外观上来看,我是谁重新打开它的人......

Edit February 2014: turns out that adding user libraries to Ant's classpath has already been requested (https://bugs.eclipse.org/bugs/show_bug.cgi?id=211669). By the looks of it, I was the one who reopened it...

这篇关于添加用户库Ant构建器类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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