0

I have a groovy script in src/it/first/ver.groovy

If I use the exec-maven-plugin I can run it, but if I use the maven-invoker-plugin I cannot. I would prefer to use the invoker...

Example of config using exec-maven-plugin :

<plugin>
    <artifactId>exec-maven-plugin</artifactId>
    <groupId>org.codehaus.mojo</groupId>
    <version>1.5.0</version>
    <executions>
        <execution>
            <phase>verify</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <executable>src/it/first/ver.groovy</executable>
            </configuration>
        </execution>
    </executions>
</plugin>

Example of config using maven-invoker-plugin:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-invoker-plugin</artifactId>
    <version>3.1.0</version>
    <configuration>
        <debug>true</debug>
        <projectsDirectory>src/it/first</projectsDirectory>
        <postBuildHookScript>ver.groovy</postBuildHookScript>
    </configuration>
    <executions>
        <execution>
            <id>integration-test</id>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
</plugin>

and the output is

[INFO] --- maven-invoker-plugin:3.1.0:run (integration-test) @ demo --- [INFO] No projects were selected for execution.

Jorge Viana
  • 396
  • 5
  • 12
  • The groovy script is usually named by a convention which is `verify.groovy`...so no need to st postBuildHookScripts...Furthermore the projectsDirectory is usually set to `src/it`...and no the exec-maven-plugin is not needed... – khmarbaise Nov 17 '18 at 07:54
  • Even if I use the conventions I don't think it's going to work. The question is that I don't understand how this plugin works... The example I gave with the exec-plugin works, but I would like to use the invoker-plugin instead. – Jorge Viana Nov 17 '18 at 18:52

0 Answers0