Skip to content
Advertisement

IntelliJ Idea not resolving Mockito and JUnit dependencies with Maven

I am using IntelliJ idea for writing simple unit test cases using JUnit and Mockito. I am using Maven for dependency management.

IntelliJ idea keeps complaining that following imports cannot be resolved:

JavaScript

Following is the dependencies section of my project:

JavaScript

Following is my project structure:

Project Structure

Advertisement

Answer

Try View -> Tool Windows -> Maven projects, then click the blue icon in the top left of the tool window (Reimport all Maven projects). You should be able to find the dependencies in the project view, under external libraries.

If this does not work, there is probably something wrong with your maven config (pom.xml). Try mvn clean install from the command line see if it gives any errors.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement