3
如何在多個項目中重用一個ant代碼片段?比方說,我有我的根pom.xml
如下:在多模塊maven build中重用ant-snippet
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>gen-index</id>
<phase>package</phase>
<configuration>
<target>
... some non-trivial ant stuff here ...
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
<execution>
</executions>
</plugin>
我怎麼能有選定子項目執行該螞蟻片段?我已經嘗試將<plugin>...</plugin>
部分添加到<pluginManagement>...
,但我無法弄清楚如何指定應運行螞蟻代碼段的子項目。
因此,你需要在其中是一個子模塊,並宣佈上述POM父項目相同的插件運行? –
是的,類似的東西。 – JesperE
可能的重複[如何通過maven執行簡單的螞蟻調用?](http://stackoverflow.com/questions/8480606/how-do-i-execute-simple-ant-call-through-maven) –