我使用屬性Maven插件讀一些屬性來執行Maven插件多次後,再執行這個插件我執行另一個插件,之後,我想不同的配置再次執行這個插件如何
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>src/Args.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
執行Maven的antrun-插件再回想這個插件與配置「的src/Args2.properties」,因爲與去年插件我宣佈一個新的屬性,它的文件「Args2.properties
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath"/>
<if>
<equals arg1="${serviceType}" arg2="none"/>
<then>
<property name="prop" value="x"/>
</then>
<else>
<property name="prop"value="y"/>
</else>
</if>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
和Args2.properties使用:
prop2=${prop}/anotherValue
我想提供一個值在Antrun插件託從文件Args2
什麼是您的全球通緝用例?在構建過程中完全不同的時間讀取2個屬性並在兩者之間運行AntRun插件時,您想要解決什麼問題? – Tunaki
在AntRun插件中給prop一個值之後,我想稍後從Args2讀取prop2,將它包含爲prop的新值 –
是的,但這是[XY Problem](http://meta.stackexchange.com/questions/66377/what-the-xy-problem),爲什麼你有這個設置? – Tunaki