JUnit tests pass in Eclipse but fail in Maven Surefire

前端 未结 17 1968
臣服心动
臣服心动 2020-11-29 17:28

I have written some JUnit tests using JUnit 4 and spring-test libraries. When I run the tests inside Eclipse then run fine and pass. But when I run them using Maven (during

17条回答
  •  眼角桃花
    2020-11-29 17:44

    I had the same problem, and the solution for me was to allow Maven to handle all dependencies, including to local jars. I used Maven for online dependencies, and configured build path manually for local dependencies. Thus, Maven was not aware of the dependencies I configured manually.

    I used this solution to install the local jar dependencies into Maven:

    How to add local jar files in maven project?

提交回复
热议问题