When doing a clean "eclipse-files" ant build, I saw four problems on my way to getting Eclipse happy.
- Initially the external builder would fail on "contrib/eclipse-plugin". I hacked around this.
- Then, there were still 237 build problems. (I've attached them in eclipse-problems.txt, though they're genuinely uninteresting.)
- When reproducing on a Mac, I found that Eclipse would try to run ant with Java 1.5, which doesn't work for Hadoop.
- When trying to use an svn tree that I'd already checked out, the external builder would fail to find build.xml.
The patch attached attacks the four problems mentioned above. Specifically:
- The "gridmix2" classpaths are updated so that Eclipse recognize the files to be in the right package. This solves the 237 build problems. There are also whitespace changes, which make it easier to diff against the XML files generated by Eclipse's GUI.
- The "Hadoop_Ant_Builder" custom build task is updated to use Java 1.6, to use a remote ant process, and to reference $
instead of a subdirectory of the workspace. Using Java 1.6 for ant is a necessity on OS X, where Eclipse necessarily is running under Java 1.5. It also "accidentally" solves the problem for the eclipse-plugin, because its build rule is no longer triggered. The eclipse-plugin is broken for the current (Ganymede = 3.4) version of Eclipse, anyway. Finally, using a reference to the build_project directory makes the Eclipse integration work regardless of where you place your checkout.
Hudson may complain that this patch contains no tests. I tested this patch manually on Eclipse on OS X and Linux.
With this patch, there are several tests that "just work" if you right click and "Run as Junit". There are many others that don't, because of a dependency on test.build.data, and a few other properties. (See the target "test-core" in build.xml.) I'm hoping to get all the tests working in Eclipse, but that will be a separate JIRA.
I've also tried to add more details to the wiki page at http://wiki.apache.org/hadoop/EclipseEnvironment.