views:

393

answers:

5

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

A: 

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.

VonC
A: 

Have you considered installing Ant separately, creating an environment variable, and then referencing the location via the ANT_HOME environment variable within your Ant build.xml?

Kelvin Meeks
A: 

From within your eclipse, on the package explorer view, right click on the specific project and build path.

Move into the Libraries tab and select the "Add Variable..." button. From here you'll see that is where the JDK system libraries path, maven(if you're using it, tomcat, eetc...) If ANT_HOME doesn't appear, you can add it by clicking the Configure Variables... button. From this moment, the ANT_HOME path will be considered in the build path of the project.

Hope it helps.

Carlos

Carlos
A: 
clayless
+1  A: 

Your project should not have a dependency on eclipse's version of Ant in the first place, you should keep your own version so as to decouple your project from eclipse. What if a developer or yourself decides to use intelliJ?

Although i don't know what the nature of your project is, i would have thought all dependencies should be added to your projects lib directory or something similar.

Abarax