I have a lot of experience with both languages, and have also written several Maven plugins. I wrote them in Java because I had no choice, but if I had a choice, I would choose Groovy.
In my opinion, if performance is not absolutely critical, Groovy is usually a better choice than Java, no matter what you do. I say this because there is usually 30% -50% less code to write something in Groovy than in Java. Most of the code that you omit when using Groovy is what will be considered a Java code template.
Groovy compactness due to two factors
- (, , , ..)
JDK. GDK Java. , Java 10-20 ( ). Groovy, :
String fileContent = new File('/foo/bar/baz.txt').text
, GMaven Maven Groovy, , AbstractMojo, Java
, pom.xml. pom.xml , , , MavenProject.