maven surefire additionalClasspathElements single test
I have one main and one test config file which is shared by several maven projects. While testing, I am specifying the classpath to the directory where the test config file is.
This works fine if the whole project is tested/build but it doesn't work while running single tests. The config file is not found in the classpath.
here is the config:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<additionalClasspathElements>
<element>${project.parent.basedir}/conf/test</element>
</additionalClasspathElements>
</configuration>
</plugin>
any ideas why surefire igno开发者_高级运维res the property for running single tests?
thank you
Shouldn't it be:
<additionalClasspathElements>
<additionalClasspathElement>${project.parent.basedir}/conf/test</additionalClasspathElement>
</additionalClasspathElements>
put the config file in src/test/resources folder and try it .It should automatically be picked up. OR try to put under src/main/resources and use tag to point to that config file in the pom.xml of the project .Make use of 2.5 version of maven-surefire plugin.
精彩评论