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