pom.xml でプロパティを設定し、jUnit テスト中にそれらにアクセスしようとしています。それらを読みたいクラスはjUnitによってインポートされ、Test.java
使用
されてString prop = System.getProperty("target1");
いますが、常にnullです。pom.xml で既に試したこと:
...
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<target1>2948</target1>
</properties>
</profile>
</profiles>
そしてまた
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.15</version>
<systemPropertyVariables>
<target2>2948</target2>
</systemPropertyVariables>
<systemProperties>
<property>
<name>target3</name>
<value>2948</value>
</property>
</systemProperties>
...
</configuration>
...
親の pom.xml がありますが、それが問題になることはありませんか? 私はNetbeansを使用しており、pom.xmlで「テストファイル」をクリックしてテストを開始しています
ありがとう:)