In most of my projects I'm using maven as my prefered build tool. The tool is pretty mature and if you're build process doesn't change that often it ist ok. If you need a more flexible build process, ant or gradle may be the tools of your choice.
Maven ist out the box great when doing "pure" java projects. But personally I like groovy cause some things are really nice and done with much less coding and I compiles to java byte code. So even when my customer says we just want java code and could write some groovy code.
I n praxis I'm using groovy to write some Test Cases. The multiline string feature is a great advantage if you want to test some parsing or text generating code. When including the Groovy Eclipse plugin this works in my IDE but not in out maven build process, so I need some more steps:
- I've got to put my groovy code in a directory src/test/groovy (Convention over configuration) or src/main/groovy
- I've got to add the gmaven plugin in my build process
- I need to provide a groovy runtime for my testcases
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
...
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-1.7</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>org.sonatype.gossip</groupId>
<artifactId>gossip</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>

