Requires Eclipse compiler. Big cons. Especially version < 4.4 which seems to be the one used by Gmaven and maven.

The ant way is just fine and is the easiest one. The cons are pretty slim if you ask me.

But thanks for clarifying. Now I know I have made the right decision.

On 06/19/2016 07:57 PM, Keegan Witt wrote:
I put this page together to try to explain the pros and cons of different tools:


On Sun, Jun 19, 2016 at 8:09 AM, Jochen Theodorou <> wrote:
On 18.06.2016 20:12, Mr Andersson wrote:
I was able to get it to work, both as separate groovy and java
directories and as one directory ( basically a groovy directory with
mixed ).

It is interesting how complex this task was. It would appear as if the
Groovy community should have figured this out by now.

From the project side we support an ant task, command line and a programmatic way to do joint compilation. The task is complex because the build tools and the scenarios are. Gradle has much better support for Groovy because we use it for our own build, but most of all, because the Gradle people care.

I finally ( after 10 hours ) was able to get it to work, using only ANT.
The question is why Gmaven, GMaven2 Eclipse maven, and what not is even
mentioned when it is as simple as an ANT task.

command line is even more simple ;)

In constract, pulling in Scala and Kotlin ( during the process which I
gave up on Groovy ) took seconds.

well, there are some maven people, here only very few

Relying on the Eclipse compiler is not a good thing as it has a history
of breaking and not being up to date with any other compiler that one
might wish to use.

Which is why the page suggests gmavenplus for maven... maybe that should be more clear

The solution ( note that I change some other things as well, like I
don't use src/main/java but just src ):





<!-- This is an important part, especially in development mode, where we
treat the compiled output the same as when served through a container,
we place in a /WEB-INF/classes/ directory, \ rather than the default
/classes/ allowing us to have consistent resources lookup through out
all environments --> <outputDirectory>${myproject.srcOutput}</outputDirectory>


         <!-- See:
--> <useIncrementalCompilation>false</useIncrementalCompilation>

</plugin> <plugin>
                     <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
                         <classpath refid="maven.compile.classpath"/>

                     <mkdir dir="${myproject.src}"/>
                     <mkdir dir="${myproject.srcOutput}"/>
                     <groovyc destdir="${myproject.srcOutput}" srcdir="${myproject.src}" listfiles="true">
                         <classpath refid="maven.compile.classpath"/>
                             <pathelement path="${myproject.src}" />

                         <javac source="1.8" target="1.8" debug="on" encoding="UTF-8"/>


I see, good to have that here. Now what are the main cons with this?

compared with gmaven plus:
* not really integrated in maven, thus you always compile all files

compared with eclipse groovy plugin:
* stubs cannot compile as many scenarios as the integrated approach of the eclipse groovy compiler
* not really integrated in maven, thus you always compile all files

I am working on a new compiler tool for Groovy, which is supposed to have less of those disadvantages, for which I will then also look for more proper maven integration (I am hoping here on the help of gmaven plus). But that is still in the future and no fast project, because my free time is limited

bye Jochen