今天遇见了一个奇怪的问题,在IDE中run unit test,全部cases都成功了,但是后来通过mvn test运行case确保错了.在寻求原因的同时也找到了对应的解决方法. Run Unit Test和Maven test的区别 差异1:在IDE中通过选中单元测试路径,点击右键选择run test和点击maven中的test是有区别的.在Maven执行测试的过程中,是不允许测试cases访问其他项目的测试类和其他项目的resources下文件的.也就是说,在a/src/test/java下…
maven在执行过程中抛错: 引用 ... was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1] 原因就是有些jar包没有完全下载完成,在编译的时候找不到jar包.只需要在配置文件中增加一个更新策略<updatePolicy>always&l…
mvn compile/test都没报错,但是执行mvn package和mvn clean时候就报错:a required class was missing while executing....... 这时候只要更改中央仓库就可以解决问题了,具体步骤如下: 1.默认中央仓库在C盘.m2中,这样非常不安全,在非C盘(防止系统出问题重装时消失)的一个合适路径(我常用java目录)下创建一个maven文件夹, 2.在maven文件夹中创建一个repository文件夹作为自定义的中央仓库 3.m…
https://issues.apache.org/jira/browse/SUREFIRE-753 Here the pom.xml snippet how i configured the report-plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <ve…