emeraldjava
emeraldjava

Reputation: 11190

synchronising / maintaining ant and eclipse classpaths

I'd be interested to find out about any automated processes that people have for ensuring that the project classpaths for the ant and eclipse configurations are in synch. In my case, I want the classpath defined in the ant build file to be the master configuration, since its used for our production builds. As part of the build i'd like to add an ant target that will verify that the eclipse classpath is up to date, or at least indicate differences between the two classpaths.

I'm aware of ant4eclipse but its focus is in the opposite direction, ensuring that the eclipse classpath is master and that the ant build reuses the eclipse path. I like the idea behind AntAndEclipse but am wondering are their ant other tools in this space that i'm not aware of.

Upvotes: 5

Views: 1131

Answers (6)

neves
neves

Reputation: 39153

You need Ant2Eclipse.

Upvotes: 0

SteveD
SteveD

Reputation: 5405

My team wrote an Eclipse plug-in to add a new type of library to the Java Build Path->Add Library option in the project settings. This custom library type allowed both Eclipse and ANT to reference the same canonical list of dependencies.

Nowadays, I'd probably look at IVY for doing the same thing if I was locked into using ANT, rather than writing my own.

Upvotes: 0

Tobias Hilka
Tobias Hilka

Reputation: 273

Did you evaluate Apache IVY? Currently I am building a Continuous Integration environment at our place and we use IVY to handle our dependencies. There is a eclipse plugin that takes the dependency configuration of eclipse and uses it as eclipse classpath. Currently this solution looks quite promising.

Upvotes: 0

Aaron Saunders
Aaron Saunders

Reputation: 33335

there is an ant task to do xml transformations, we used that task to create the classpath in our build file. It was a little trick to get the XSL right but once it worked it was great

Upvotes: 0

Jeffrey Fredrick
Jeffrey Fredrick

Reputation: 4503

You solution at a previous company was to have ant invoke Eclipse to do the compiles as described here:

http://www.eclipse.org/articles/Article-PDE-Automation/automation.html

Upvotes: 1

Aaron Digulla
Aaron Digulla

Reputation: 328556

I'm not aware of any ant tools which can do this but I've switched from ant to Maven a few years ago and never looked back. You can use the "Maven integration for Eclipse" to make Eclipse use the Maven classpath.

As of today, I'm not 100% happy with the Eclipse plugin, though. It's a bit slow and due to the different philosophy of Eclipse and Maven, some operations behave strange. For example, Eclipse doesn't differentiate between a "production" and "test" classpath, so you can get compile errors in Maven when everything looks great in Eclipse.

My solution was to use the plugin to keep the classpath in sync and compile from the commandline.

Upvotes: 0

Related Questions