I received emails from my readers that some of them not able to add dependency in Maven project even in older versions of Eclipse e.g. It is totally due to absent of artifact index file.
One you enable "Download repository Index updates on startup" option and restart Eclipse, you will see that Eclipse is updating index at the bottom right corner, once this update this finish, you would be able to add dependency using Eclipse Maven GUI.
|____|____src | |____main | | |____java | | | |____com | | | | |____mkyong | | | | | |____controller | | | | | | |____Base | | |____resources | | | |____| | |____webapp | | | |____WEB-INF | | | | |____| | | | |____pages | | | | | |____| | | | |____package com.mkyong.controller; import org.slf4j.
Logger Factory; import org.springframework.stereotype.
If that file is not download or not exist due to any reason, Maven's dependency search will not work in Eclipse.
That's why you need to check the option "Download repository Index updates on startup".
Main problem here is that Eclipse is not able to search for dependencies when you enter some keyword in search box.
If you know the artifact id and group id you can directly add any dependency but most of us doesn't remember that, what we do is search for that artifact or JAR by typing e.g.
to add JAR file related to Hibernate or Spring Framework you will type hibernate or spring framework in given search bar.
This screenshot is immediately after restarting Eclipse, you can see that at bottom right corner it showing as Updating index, which is the proof that it's now downloading index file.
If you double click there it will open the view which we have shown in next screenshot, there you can see that it downloads dependencies form Maven central remote repository.