Mavenプラグイン–同じフェーズでの実行順序
Mavenでは、build lifecycleまたはフェーズを使用して、プラグインの実行順序を制御できます。 In some scenario, you have to bound few plugins to same phase, but still want to control the order of the plugin execution.
溶液
このバグはMaven3.0.3、Maven plugin bound to same phase will
be executed in the same order as they are listed in the pom.xml
で修正されています
たとえば、フェーズ「prepare-package」にバインドされた3つのプラグイン。
maven-clean-plugin 2.2 auto-clean prepare-package //...org.apache.maven.plugins maven-resources-plugin 2.5 copy-resources prepare-package //...org.primefaces.extensions resources-optimizer-maven-plugin 0.5 optimize prepare-package //...
mvn prepare-package
を実行すると、pom.xml
にリストされている順序と同じように、次の順序で実行されます。
-
maven-clean-plugin
-
maven-resources-plugin
-
resources-optimizer-maven-plugin