13

I loaded a Maven project in IntelliJ IDEA, when I run 'mvn clean package' in the terminal, it works fine, but IntelliJ IDEA can not debug or build it and in the UI, maven project tab, shows the following (red line on dependencies):

omitted for conflict with STH

enter image description here How should I fix it?

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
user3426603
  • 617
  • 2
  • 9
  • 26

6 Answers6

7

Re imported and restart(Invalidate Caches / Restart) the IntelliJ. that was working

enter image description here

Sandun Chathuranga
  • 2,242
  • 2
  • 13
  • 27
Rajitha Bhanuka
  • 714
  • 10
  • 11
0

Had the same issue.

Instead of

File > Open

used

File > New > Import from Existing Sources

and it worked

Horatiu Jeflea
  • 7,256
  • 6
  • 38
  • 67
0

You can do File-> Invalidate Caches/Restart... The errors will be gone after IntelliJ restarts.

sarathezil
  • 11
  • 2
0

Just rebooting IntelliJ did the trick for me. Simple but effective.

Seadrill
  • 31
  • 3
0

I had the same issue with an old project of mine which was developed with Eclipse. I had to go to switch to an older version of maven and not the build-in version from intelliJ. settings > maven > change maven home directory

cajo
  • 1
  • 3
0

Check if the jar is downloaded in m2 folder , if it is downloaded and its not showing in intellij then add the same maven dependency in module where you are trying to use the classes in the jar.

Sunil N
  • 41
  • 3