我有一堆需要在構建/部署階段使用maven-antrun-plugin執行相同順序的ant任務的maven項目。在maven插件中包裝一堆ant任務?
我不想在父項目中重寫maven-antrun-plugin的實現,所以使用此插件的所有其他項目都將繼承這些步驟。
因此,我正在尋找編寫我自己的maven插件,它可以作爲一個maven-antrun-plugin包裝器,並具有特殊的ant任務序列。但目前我沒有做到這一點。
我已經看過:
http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html
但碰上這裏描述了同樣的問題:
http://www.mail-archive.com/[email protected]/msg92676.html
(使用上述職位建議的版本並沒有解決問題)
和來自: http://www.mail-archive.com/[email protected]/msg115264.html 它看起來像本教程僅適用於在Maven2:
我也試圖從這裏偷東西:
http://maven.apache.org/guides/plugin/guide-java-plugin-development.html
,但仍然沒有工作的插件。
,我想包裝插件看起來是這樣的:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>test</id>
<phase>deploy</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!-- execute task A,B and D -->
</tasks>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
是否有可能把任務A,B和C的順序列於其他插件的再使用過的位置需要的插件?
我也試圖給antrun插件移動到家長和禁用它的一些孩子們設置繼承假的:
,但在父定義的任務仍在執行,從而將繼承設置爲false似乎不起作用。