2

All of a sudden maven (in IntelliJ IDEA) doesn't find any artifacts any more. I used to be able to just click on the class and maven would automatically add the corresponding dependency to the pom file.

All of a sudden, maven doesn't find anything any more, see screenshot:

enter image description here

Under Preferences -> Build, Execution, Deployment -> Build Tools -> Maven -> Repositories, I updated the remote maven repository.

It didn't help.

How can I fix this?


UPDATE: here's the address of the maven repository I use: enter image description here


UPDATE 2:

1) There is no settings.xml file in folder .m2 because I haven't changed the default location of my local maven repository. 2) Under Preferences -> Build, Execution, Deployment -> Build Tools -> Maven, one sees this: enter image description here

steady_progress
  • 3,311
  • 10
  • 31
  • 62
  • 1
    Check that you use the Maven Central with HTTPS. This is likely you are using the HTTP one, which is no longer available. – NoDataFound Feb 01 '20 at 21:51
  • @NoDataFound Thank you for your comment ... it's https though, see the update to the post – steady_progress Feb 01 '20 at 21:55
  • 1
    Check if Intellij (preferences) is using the correct maven (version, settings). Also, check your settings.xml file in .m2 folder. – Hedi Ayed Feb 01 '20 at 21:59
  • 1
    Have the indexes finished rebuilding? – Thorbjørn Ravn Andersen Feb 02 '20 at 15:19
  • @HediAyed: what do you mean by the correct maven? ... what would be an incorrect maven? As you can see from the screenshot in my post, my IntelliJ IDEA uses maven version 3.6.1. Is that ok? – steady_progress Feb 02 '20 at 21:39
  • @ThorbjørnRavnAndersen ... thank you for your comment ... what do you mean by "Have the indexes finished rebuilding?" ... Maybe it's a stupid question but: which indexes do you mean? And why would they rebuild? – steady_progress Feb 02 '20 at 21:43
  • One of IntelliJ's forces is that it indexes _everything_ so that you can search in it and that it can use that information to give qualified assistance. When you update the Maven remote repository it is my understanding that a redownload takes place and then indexes needs to be built anew before IntelliJ can assist you properly again. – Thorbjørn Ravn Andersen Feb 02 '20 at 21:52

2 Answers2

1

Try just using the embedded Maven without adding any repository URL, works for me

Meow
  • 135
  • 2
  • 12
0

There is a bug: IDEA-215618 that is planned to be fixed in 2020.1 IDE version update. As a workaround you could use Search for artifact tab.

Andrey
  • 15,144
  • 25
  • 91
  • 187