4
我想使用一些外部jar依赖项编译测试文件,这些依赖项不会出现在pom.xml的依赖项标记中。有没有办法通过配置。像这个 -如何将其他类路径依赖项传递给maven中的testCompile阶段
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
<executions>
<execution>
<id>test-compile</id>
<configuration>
<classPathElements>
<classPathElement>somejar.jar</classPathElement>
</classPathElements>
</configuration>
</execution>
</executions>
</plugin>
只是一个小问题库。您是否需要使用外部JAR编译测试类,或者是否需要使用外部JAR执行测试? –
其实这两个,但为执行我使用maven-surefire-plugin ..其中有选项可以使用标记传递外部瓶子 –
Disha
你为什么要尝试这样做? (除了你不能的事实)。 – Tunaki