我在src/it/first/ver.groovy
中有一个时髦的脚本
如果我使用exec-maven-plugin
,则可以运行它,但是如果我使用maven-invoker-plugin
,则不能运行。我更喜欢使用调用程序...
使用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>
使用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>
输出为
[INFO] --- maven-invoker-plugin:3.1.0:run (integration-test) @ demo ---
[INFO] No projects were selected for execution.