Issue
I tried to migrate to java 11. But when I change the version of plugin maven-surefire-plugin to 2.22.2 that supports java 11, maven or IntelliJ can not find it:
I tried with other versions >= 2.20, but had same error. I tried to fix it:
- Firstly, invalidate caches and restart IntelliJ, then reimport maven. But still error.
- I deleted all directories in ~/.m2/repository/org/apache/maven/plugins, and then reimport maven. But maven imported plugin maven-surefire-plugin version 2.19.1 automatically, not imported version 2.22.2 (:
- Update: I installed maven-surefire-plugin version 2.22.2 successfully by maven command line: mvn install. It downloaded the plugin but IntelliJ still has the error. I tried to invalidate caches and restart IntelliJ, it worked.
Thanks @Andrey for the great suggestion!
Solution
I fixed this issue, I do:
- I installed maven-surefire-plugin version 2.22.2 successfully by maven command line: mvn install. It downloaded the plugin but IntelliJ still has the error.
- And then I tried to invalidate caches and restart IntelliJ, it worked.
Thanks @Andrey for the great suggestion!
Answered By - The Sun
Answer Checked By - David Marino (JavaFixing Volunteer)