I want to write a Maven plugin in Groovy, but under Eclipse (Galileo).
- I’ve downloaded and installed Groovy-Eclipse plugin
- I’ve created my very simple POM file (included below).
- I’ve created a simple Echo mojo and place it under “/src/main/groovy/com/acme/maven/plugins/foo”.
- I performed “Import Existing Maven Project” in Eclipse (using M2Eclipse plugin).
The problem is that I don’t see “src/main/groovy” as a source folder, which makes it hard to develop:
– I have to create the package directory structure (com/acme/maven/plugins/foo) manually
– Refactoring probably won’t work easily
– Incremental probably won’t work.
How do you guys develop your Maven plugins using Groovy in Eclipse?
You should definitvly install the Groovy-Eclipse plugin if you plan to develop Groovy code in Eclipse. You can find all the details here:
http://groovy.codehaus.org/Eclipse+Plugin
You should also add the Groovy Maven Plugin to your
pom.xmllike this (see this page for details):Now update your Eclipse project configuration via
Right-click on project -> Maven -> Update project configuration. Now you should see that thesrc/main/groovyfolder has been added to the source folders.