score:60

Accepted answer

i had similar situation and by googling for a while i found out that this is most likely because your central repository index might never have been updated. for this what you can do is

  1. go to window > show view > other > type maven in filter and select maven repositories.
  2. in maven repositories tab expand global repositories, right-click on central and update index.

also you can set up index to update on eclipse startup windows > preferences > maven and check "download repository index updates on startup".

hope this helps some one else.

score:0

i did "in maven repositories tab expand global repositories, right-click on central and update index", it did not work, then click left expand triangle, it ran, and wait for while. now it works

score:0

i had the same problem. i have done what yogi and erasmus77 said but after all the message "artifact id cannot be empty" remained. so i ignored the message and i wrote the dependency in the search bar and then results appeared!

thank you for this question!

score:0

in case it can help someone... i had the same problem, tried to fix it doing all the steps everyone is mentioning in the other answers and i couldn't fix it like that. in the end, the solution was to delete the content of the settings.xml file in my .m2 folder. for some reason, it was using a different global repository, not the default maven one. after that, i got the expected behaviour.

score:0

i recently had this same issue. i followed all of the suggestion above and the problem persisted. then i opened the "local repository", right click on the "local repository" sub link>rebuild index. that fixed the issue. so, if "rebuild index" on the "global repository/central" doesn't work, try "rebuild index" on the "local repository/local repository"

score:1

another gotcha is that it won't start searching until you've entered several characters

  1. nz.ac
  2. com.mi
  3. junit

score:1

i had same problem! it is because you do not have sts (spring tool suite) installed. go to marketplace install it and it is gonna work!

score:3

i solved the same problem by going to window > show view > other > maven > maven repositories

expand global repositories right click central > rebuild index (wait for it) when it finishes expand local repositories and do the same for the local repository (rebuild index) if you encounter some error simply try again. it worked for the second time and now i can search maven repo.

score:4

very strange but now it worked using the following way:

  1. add some dependency directly in the pom.xml
  2. save the pom.xml to trigger the change. now the library added directly appears in the project.
  3. now i also got messages in the status bar like "indexing... " and "searching repository"
  4. i am now able to add an dependency using the method from the question. it now retrieves a list of artifacts of which i can choose.

maybe a bug as also the add dialog should trigger the first repository search/indexing.

the information: "artifact id cannot be empty" still appears and had nothing to do with the problem.

score:10

windows > preferences > maven and check "download repository index updates on startup".

restart and you're all fixed.


Related Query