根据http://maven.40175.n5.nabble.com/Trouble-with-Java-Native-Libraries-
td114063.html,
surefire插件会启动VM,然后在将控制权传递给junit测试类之前修改系统属性。对于VM来说为时已晚,在初始化VM时需要设置java.library.path。
因此,我们需要在启动时提供通往Surefire的途径。以下工作:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkMode>once</forkMode> <argLine>-Djava.library.path=${project.build.directory}/libs/natives/win32:${project.build.directory}/libs/natives/linux:${project.build.directory}/libs/natives/macosx:${project.build.directory}/libs/natives/solaris</argLine> </configuration> </plugin>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)