Using with integration-test phase

33 views
Skip to first unread message

Michael Pratt

unread,
Jun 15, 2017, 7:55:01 PM6/15/17
to GMavenPlus
Hi all,

We have a suite of Groovy scripts that we use an integration tests (they actually call out to our microservices and validate responses). I have a case where I need to execute a Groovy script as part of the integration-test phase instead of testCompile. The reason is we have some pre- and post-integration steps that setup 3rd party dependencies like Kafka, and when the script runs during testCompile those dependencies are not available.

Here is my plugin definition for gmavenplus-plugin. This is mostly verbatim from the sample, except I've added the <phase> tag, which doesn't seem to help.

               <plugin>
                 
<groupId>org.codehaus.gmavenplus</groupId>
                 
<artifactId>gmavenplus-plugin</artifactId>
                 
<version>1.5</version>
                 
<executions>
                     
<execution>
                       
<phase>integration-test</phase>
                       
<goals>
                           
<goal>testCompile</goal>
                       
</goals>
                     
</execution>
                 
</executions>
                 
<configuration>
                     
<testSources>
                       
<testSource>
                           
<directory>${project.basedir}/src/${test.base.dir}/groovy</directory>
                           
<includes>
                             
<include>**/*.groovy</include>
                           
</includes>
                       
</testSource>
                     
</testSources>
                 
</configuration>
               
</plugin>

Is it possible to only have this execute during integration-test phase? Everything I've tried still executes the scripts during compile which will always fail in my case.

Thanks!

Mike

Keegan Witt

unread,
Sep 13, 2017, 10:58:04 PM9/13/17
to GMavenPlus
Sorry for the late response, this got lost in my inbox.  I assume you're using failsafe plugin and invoking mvn  verify, install, or deploy?

-Keegan
Reply all
Reply to author
Forward
0 new messages