14
Oct/08
3

Configuring Eclipse To Use Command Line Ant

Today I finally got around to reconfiguring my local Ant install.  I updated to the latest version and also configured Eclipse to use the same Ant files.

I’ve known you could do this for awhile but today I was talking to Qasim in our daily scrum and finally decided to take a bit of time to do this and document it on our internal WIKI so the whole team can get setup the same way.

Lets get started!

Next I have some additional Ant tasks (antcontrib, mail, etc)  that require some additional jar files.  You can copy those to your newly installed Ant lib directory:  D:\ant\lib

Note: At some point I will probably move these additional tasks off to a network share so we can all reference the same tasks – but for now I’m going to KISS and just dump them in the local directory.

Now we need to configure Eclipse to point to our new installation of Ant instead of it’s own copy.

  • Open Eclipse
  • Click Window > Preferences
  • Expand Ant
  • Click Runtime
  • Note Ant paths are local to Eclipse
Eclipse Ant

Eclipse Ant Preferences

  • Click ‘Ant Home’
  • Navigate to your newly installed Ant directory
Local Ant directory

Local Ant directory

  • Select the Ant directory
  • Click OK
  • Click OK (exit Preferences)
  • Verify your Ant tasks work!

Now you should be able to run the same tasks from the command line or from within Eclipse and use the same task extensions.

Possibly Related:

Tagged as: ,
Comments (2) Trackbacks (1)
  1. Rob Wilkerson
    12:32 pm on October 15th, 2008

    Nice. I wrote about how to do exactly the opposite a while back just to reduce the number of Ant installs I had laying around. :-)

  2. Qasim Rasheed
    10:07 pm on October 15th, 2008

    Glad to hear that you were able to set up a central ANT installation. By the way thanks for explaining this publicly – I am sure a lot of people will benefit from this write up.

Sorry, the comment form is closed at this time.