1. 程式人生 > >Maven 外掛 執行install同時執行groovy指令碼

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");