8
votes

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?

5
try right-clicking the pom.xml -> Maven -> Reimport. Did it help?cahen
What Maven version do you use for importing? See if this answer helps to resolve the problem.CrazyCoder
Do you have any unchecked profiles?Deltharis
After reimporting I just restarted my client and found that this has been resolved. I made sure that it is not happening due to some conflicts by conflicting dependencies by generating dependency tree using "mvn dependency:tree -Dverbos" before though.Sumit Kushwaha
After restarting IntelliJ the issue was gone. I'm using IntelliJ 2017.2.5.mwalter

5 Answers

4
votes

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

enter image description here

0
votes

Had the same issue.

Instead of

File > Open

used

File > New > Import from Existing Sources

and it worked

0
votes

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

0
votes

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

0
votes

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