これはgroovyスクリプトファイルMavenInit.groovyで、次のようにpom.xmlで実行します。var 'SCRIPTS_GROOVY'は別のpom.xmlで定義されています。 「DIR_TARGET」の定義は、どのようにant = new AntBuilder()
どのようにGroovyでのアリの使用
SCRIPTS_GROOVY=project.properties['SCRIPTS_GROOVY']
ant.pathconvert(targetos:"unix", property:"DIR_TARGET") {
path(location:project.build.directory)
}
DIR_TARGET=ant.project.properties['DIR_TARGET']
project.properties.setProperty('DIR_TARGET', "${DIR_TARGET}")
project.properties.setProperty('DIR_LOGS', "${DIR_TARGET}/logs")
ant.mkdir(dir:"${DIR_TARGET}/logs")
ずに直接アリを使用できる場所のpom.xmlは、私が定義された「DIR_TARGET」が初期見つけることができますどのように
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<id>set-maven-property</id>
<phase>initialize</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scripts>
<script>file:///${SCRIPTS_GROOVY}/MavenInit.groovy</script>
</scripts>
</configuration>
</execution>
<execution>
<id>Windows-package</id>
<phase>compile</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scripts>
<script>file:///${SCRIPTS_GROOVY}/PackageWindows.groovy</script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
に従うようMavenInit.groovyをexcute値を変更する
について、そのスクリプトに210
本当にありがとうございました、とあなたは推測してください可能性がありotどこ$ {DIR_TARGET}は –
@ TJSeasonを定義した私の答えを更新しました。 – aristotll