I’ve been using eclipse in conjunction with gradle and gradle’s eclipse and eclipse-wtp plugins, and I’ve been happy with it for the most part, but there are some areas that I think could use some improvements.
cleanEclipse should also remove files compiled with eclipse. This is similar to how “gradle clean” works with removing the “build” dir. If not this, then a separate task at least to remove these files would be beneficial. I’ve created a task called cleanEclipseBin that does this.
cleanEclipse should remove the .settings dir. Right now it seems to rely on gradle’s task auto-cleaning functionality but often leaves a lot of files that the eclipse IDE may have generated itself. If not this, then a separate task at least to remove these files would be beneficial. I’ve created a task called cleanEclipseSettings that does this.
Add (and probably make default) a way to separate src/main and src/test sourceSets. By default, these sources are compiled into the same directory which can mess up testing and especially deployment. In my projects, I’ve applied a fix that modifies eclipse.classpath, looking for entries starting with “src/test/” and setting their output to “bin/test”, and it changes the defaultOutputDir to “bin/main”. This works but its behavior is a bit quirky, requiring me to clear the classpath entries before doing this step.
(eclipse-wtp) Please increase the default version of eclipse.wtp.facet ‘jst.web’ and perhaps add an easier way to change this. Default version 2.4 is quite old, and while the code to change this isn’t too bad, it currently needs to be done to each of my projects and is less concise than a JstWebFacetVersion property or something.
(eclipse-wtp) Make sure the eclipse.classpath entry ‘org.eclipse.jst.j2ee.internal.web.container’ is listed last. In eclipse, this is reflected as Web App Libraries being the last libraries entry. Eclipse doesn’t properly resolve libraries otherwise.
I think this would help remove a lot of the required tweaks that many projects may need to make so that gradle can properly generate eclipse project files.
I currently have a separate plugin that I run which applies these and other fixes so that project-specific configurations can remain small.
Does this sound useful?