I am trying to run Spock tests and perhaps some Groovy scripts, currently for a Groovy app, but in future for Java projects as well.
I am really confused about which plugins should be used and how to best configure them, aka least amount of code.
I found numerous articles showing Maven XML settings for gmaven-plugin
, gmaven-runtime
and groovy-eclipse
plugin, which seems like it works under IDEA as well.
I have been using Eclipse for a while and now am trying out IDEA Community Edition.
One of the confusions stems from the fact that I was able to add following dependency to my POM, in addition to having Gmaven in section.
<dependency>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.5</version>
</dependency>
I understand that the question is a bit vague... but so is documentation on the matter :)
For fully Maven-Groovy projects read this post Building your Groovy 2.0 projects with Maven
I have sample project with Maven, Java and Spock tests. There is one requirement here. Spock tests needs to have names like
FooTest.groovy
.My configuration looks like this
Fully working project is here: https://github.com/mariuszs/java-spock-test-sample