simbro
simbro

Reputation: 3672

IntelliJ can't find installed packages

I've just installed IntelliJ and imported a Maven / Spring Boot project. I've set up my run configuration as "application", but when I try to run it, it fails and complains of not being able to resolve dependencies. When I check my local Maven repository, those dependencies are installed:

/Users/user/Projects/myapplication/src/test/java/com/something
/SomethingServiceTest.java:23:29
java: package org.junit.jupiter.api does not exist

local maven repo:

$ ll ~/.m2/repository/org/junit/jupiter/
total 0
drwxr-xr-x  6 user  Users   192B 21 Aug  2020 ./
drwxr-xr-x  6 user  Users   192B  2 Sep  2020 ../
drwxr-xr-x  3 user  Users    96B 21 Aug  2020 junit-jupiter/
drwxr-xr-x  3 user  Users    96B 21 Aug  2020 junit-jupiter-api/
drwxr-xr-x  3 user  Users    96B 21 Aug  2020 junit-jupiter-engine/
drwxr-xr-x  3 user  Users    96B 21 Aug  2020 junit-jupiter-params/

Upvotes: 2

Views: 946

Answers (2)

Simon Martinelli
Simon Martinelli

Reputation: 36143

IntelliJ and the pom.xml are probably not in-sync.

Right click on the pom.xml and Maven -> Reload Project

Upvotes: 5

jonas.lima
jonas.lima

Reputation: 116

I've been the same problems. Sometimes I try to remove or change the name of the ~/.m2/repository directory. After that, I make

mvn clean compile and install

Try this.

Upvotes: -1

Related Questions