Wednesday, March 20, 2013

Setting up eclipse working sets using maven

Setting up eclipse with maven using a combination of the eclipse plugin for maven and the deegree maven plugin works pretty good. Unfortunately, we've got more than a hundred modules in the deegree code right now, which means the list gets really long in eclipse.

Of course, eclipse supports working sets, which can be used to group projects. But it's a lot of click work to organize all those projects into working sets, especially if you remove and re-add the projects often (eg. if you switch branches often).

Since I really dislike clicking often, I've decided to add a new mojo to the deegree maven plugin which saves me the trouble of configuring working sets and adding projects to them.

Since deegree module names follow a certain pattern (deegree-<modulegroup>-<name>, eg. deegree-featurestore-sql) it's a good guess to use the module groups as working set names. For example all deegree-core-* modules will be put into the d3-core working set, all deegree-featurestore-* modules into d3-featurestore.

To set up the working sets using the plugin, run the following line in the deegree root:

mvn org.deegree:deegree-maven-plugin:1.19-SNAPSHOT:setup-eclipse-working-sets -Declipse.workspace=$HOME/workspaces/test/

Use -Declipse.workspace to specify the workspace to modify, and optionally -Dworkingset-prefix to configure something other than d3- as a working set name prefix.

If you're generally interested in what the deegree maven plugin can do for you, check out the documentation.

Please note that this plugin is highly experimental, and has only been tested on the latest eclipse version. It might just destroy your eclipse workspace configuration! Use at your own risk!

Please also note that 1.19 of the deegree maven plugin is not yet released, you'll have to checkout my feature branch at GitHub and build it yourself (1.19 is probably going to be released on 2nd of April).

Edit:

1.19 has been released, you can use this out of the box now. Please note that it is indeed experimental, sometimes the working sets seem to be lost for some reason. In that case, re-doing the procedure works (for me).