Reputation: 85
I am having an issue about the junit, the IDE cannot resolve symbol for 'junit' even if I have it installed:
If I changed junit to version 4.11, this problem will be solved, but every time I run the test, it will give me error and ask me to use junit 4.12 or higher version.
Here is my project dependencies:
Anyone knows how to solve it? I have finish everything, and just waiting for the test. Thanks in advance!
Run 'mvn clean package', gives compilation error:
Upvotes: 0
Views: 2882
Reputation: 2109
Your project cached an older version. You don't have to set junit version, the annotation spring-boot-starter-test will take care of it. Please consider running clean command in terminal at parent root folder:
mvn clean
And reimport dependencies by clicking Manven Projects on the right and the first button:
If it does not work, maybe you installed an older version by mistake. You should run:
mvn clean package
UPDATE:
Your maven repository .m2 folder has multiple versions of junit. The simplest way is to delete and build the project again. The .m2 folder will be recreated automatically.
Upvotes: 1
Reputation:
Two things you could try:
Upvotes: 1