Prometheus Blogs

Configuring Spock integration tests, written in Groovy, with the Maven failsafe plugin


Maven failsafe plugin works fine with the normal JUnit test cases. But what if you wanted to use the Spock framework for your integration tests? This post will focus on the configuring Spock tests written in Groovy because the maven build configuration is tricky when it comes to Groovy. Initially, I used a “.groovy” file extension in the maven failsafe plugin configuration Include entry but the Spock tests did not run at all in my experience. After trying out several things the only way I found a solution to the problem was to add another Include configuration entry with a “.java” file extension for the same Spock Groovy class and it worked. Here’s the relevant part of the maven POM build configuration shown below.

Reader Comments
  1. Ittai said... around almost 4 years ago
    Hi, Did you end up finding why or filing a bug? I just stumbled on to this since we have a mixed Java/Scala codebase and so our maven config always contained both above lines. New OSS project with only Scala surfaced this...
  2. Sunil Bhaskarla said... around almost 4 years ago
    Hi Ittai, I don't know the real reason but my only guess was to realize Groovy complied into Java so I added an explicit instruction. And I didn't file a bug. Not a bad idea to create one if one doesn't exist by now.
  3. sdvsvd said... around about 1 year ago - 예스카지노 - 더킹카지노 - 카지노사이트검증 - 바카라주소
  4. hsdvsvds said... around about 1 year ago - 맞고사이트 - 식보사이트 - 룰렛사이트 - 바카라사이트 - 모바일카지노
Leave a Comment