我想使用一些外部jar依赖项来编译测试文件,这些依赖项不会出现在pom.xml的依赖项标记中.有没有办法通过配置.像这样的东西 –
<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>
解决方法
试试这个,它包括你项目中的库
<dependency> <groupId>mylib</groupId> <artifactId>com.mylib</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/mylib.jar</systemPath> </dependency>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。