Skip to end of metadata
Go to start of metadata

Compiling your Groovy sources

The compilation goals (including those for joint compilation) for GMavenPlus are bound to their respective phases in the build lifecycle. So to compile your sources, you need only tell maven how much of the lifecycle to execute. The following will compile your sources:

mvn compile

To compile your test sources, you'll do:

mvn test-compile

The above command will execute both compiler:compile and compiler:testCompile since the compile phase happens a few phases before the test-compile phase.

Configuring GMavenPlus

<goal>generateStubs</goal> <goal>compile</goal> <goal>testGenerateStubs</goal> <goal>testCompile</goal>

</goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> </plugin> <
        <!-- if including source jars, use the no-fork goals
otherwise both the Groovy sources and Java stub sources will get included in your jar -->
<!-- source plugin \> = 2.1 is required to use the no-fork goals -->
</plugins> </build> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <!-- any version of Groovy \>= 1.8.2 should work here --> <version>2.4.1</version> </dependency> </dependencies> </project>

  • No labels

1 Comment

  1. Note that Groovy 1.7.1 seems to cause errors.  The error I saw in my integration test suite was

    [ERROR] Failed to execute goal on project gmavenplus-plugin-it-basicCompile: Could not resolve dependencies for project org.codehaus.gmavenplus:gmavenplus-plugin-it-basicCompile:jar:testing: Failure to find org.fusesource.jansi:jansi:jar:1.1 in file:///C:/Users/Keegan/.m2/repository was cached in the local repository, resolution will not be reattempted until the update interval of local.central has elapsed or updates are forced -> [Help 1]

    This can be avoided by adding this exclusion to your Groovy dependency


    Or just use a different version of Groovy.  This is caused by some bad dependencies that were added to that particular version of Groovy.  See this conversation.