configuration
次のセクション内で構成できるMavenプラグインを分析していますplugin
。
<plugin>
...
<executions>...</executions>
<configuration>
<!-- items placed here are visible to the MOJO -->
</configuration>
</plugin>
execution
ただし、プラグインは、の構成アイテムを完全に無視します。
<plugin>
...
<executions>
<execution>
<id>execution1</id>
<phase>test</phase>
<goals><goal>test</goal></goals>
<configuration>
<!-- items placed here are ignored -->
</configuration>
</execution>
</executions>
</plugin>
Mavenをで実行しmvn test
ます。Mavenは正しく印刷するので、実行は確実に行われますが、プラグインは構成されていません。セクションがの外に移動id
したときに存在しない誤った設定に関する警告を出力します。<configuration>
<executions>
質問:プラグインが「トップレベル」の構成のみを受け入れるのは、プラグインの実装方法ですか?私はそのソースコードを調べましたが、MOJOクラスでセッターを呼び出すのはMavenであり、オプションがどのセクションから来たのかはプラグインに対して透過的であるように見えました。
MOJOには次の注釈が付けられています。
* @component
* @goal test
* @phase test
* @execute phase="jasmine-process-test-resources"