9
Mavenビルドにいくつかのシステム変数を渡したいと思います。もし私がmvn clean install -Dfirst.variable=value -Dsecond.variable=second.value
を使用していれば、すべて問題ありません。しかしpom.xml
でこの設定は動作しません。Maven-surefire-pluginでシステム変数を渡す
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.3</version>
<executions>
<execution>
<id>tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
<systemPropertyVariables>
<first.variable>${value}</first.variable>
<second.variable>${second.value}</second.variable>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
私は、<phase/>
と<goals>
せずにこの設定を使用しようとしましたが、それは助けにはなりませんでした。プラグインが実行されない可能性はありますか?これらの変数のハードコードされた値でさえも合格しません。もしそうなら、考えられる解決策は何ですか?前もって感謝します。
ありがとう、それは働いた!私はのコードサンプルを見て、うまく動作するはずです。そのような行動の理由は何ですか? –