Skip navigation.

BlogtimeException

By Behrang Saeedzadeh (the 5th incarnation)

Posts tagged with "Ant"

How to use Tomcat's Ant tasks in Eclipse

, , ,

Tested Configuration:
  • Eclipse 3.2 and WTP 1.5 Co-bundle
  • Tomcat 5.5.17
  • Windows XP
It's very easy to add aditional JARs to the Ant runtime of Eclipse, and then define external tasks that are not available to Ant by default.

To add additional JARs to the Ant runtime, go to Windows -> Preferences -> Ant -> Runtime, click on the Ant Home Entries (Default), and add your required JARs by clicking on the Add External JARs. The JAR file that contains Tomcat's Ant tasks is located %TOMCAT_HOME%\server\lib and is named catalina-ant.jar. By adding it to the Ant's runtime, you can now define Tomcat tasks in the Ant editor and invoke them if needed.



Nevertheless, there's still room for improvement! For one, when I enter some text inside the classname attribute of the taskdef element and suchlike attributes, I expect Eclipse to assist me by providing content assist. The way IDEA does this is just fine. Also it would be nice if I could assign shortcut keys to my Ant targets. Again IDEA supports this.

Anyways! We're forced to use Eclipse 3.2 + WTP 1.5 at work for developing MyFaces Portlets. But unfortunately WTP 1.5 is not mature enough for such tasks. Though that Eclipse rocks for desktop development, Web development with Eclipse is not that much fun! I hope by leveraging some features of Eclipse that I wasn't using prior to this, I can make it more pleasant :smile: