Build Eclipse projects w/o Eclipse

how-to
Aug 13, 20082 mins

While working on some Eclipse plugins I stumbled over a problem. And the problem is: there is almost no way to develop an Eclipse plugin and not to use Eclipse PDE (Plug-in Development Environment). I could tolerate the oblige to use Eclipse PDE, but I learned not to stick to proprietary build systems. Asking people to install an IDE just to be able to compile and build from your source package is a bad manner. One option is to produce an Ant script from your project in Eclipse. Another one that I came across is a very interesting SourceForge project – ant4eclipse. It integrates into Ant making it possible to build Eclipse project outside Eclipse. Although it still requires Eclipse to be present somewhere in the system I’m pretty sure that it only needs a number of libraries that could be placed along with libs in your source package. This also makes it possible to put your Eclipse project on some continuous build system like CruiseControl. But what is much appreciated by me is ant4eclipse ability to understand plugin.xml configuration and to build an Eclipse plugin project. So that now I use Eclipse PDE only as an utility to generate plugin.xml file, do all coding in my favorite IDE, and build using Ant build.xml. Unfortunately ant4eclipse has some issues on Linux, but hopefully it will be fixed sometime soon. UPD: The problem with Linux was Equinox failing to detect my window system, it thought it was motif, not gtk. So setting right ANT_OPTS resolved the issue: -Dosgi.ws=gtk P.S. If you prefer Maven – there are some Eclipse plugins available to produce a POM out of Eclipse project. Not sure if they work with plugin projects though.