Maven 插件 执行install同时执行groovy脚本

pom.xml


<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
        <?m2e execute?>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <source>${basedir}/src/main/resources/build.groovy</source>
        <lifecycleMappingMetadata>
            <pluginExecutions>
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>org.codehaus.gmaven</groupId>
                        <artifactId>gmaven-plugin</artifactId>
                        <versionRange>[1.3.0,)</versionRange>
                        <goals>
                            <goal>execute</goal>
                            <goal>compile</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <ignore></ignore>
                    </action>
                </pluginExecution>
            </pluginExecutions>
        </lifecycleMappingMetadata>
    </configuration>
          <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.10.3</version>
        </dependency>
    </dependencies>
</plugin>

build.groovy


log.info("Test");

猜你喜欢

转载自blog.csdn.net/cenbaolin/article/details/80522268