0

I am using Eclipse Mars 4.5.2 which by default contains Maven. I created a new Maven project and when I try to add dependencies through pom.xml, by clicking on the dependency tab and adding it. After I entered "spring framework" in search bar, it is not showing any result (in windows 10).

enter image description here

How to fix this issue?

dambros
  • 4,252
  • 1
  • 23
  • 39
honey1
  • 75
  • 1
  • 14

3 Answers3

0

Just manually edit the pom.xml after creation of the project and e.g. search Spring on MavenCentral (e.g. here: http://search.maven.org/#search%7Cga%7C1%7CSpring).

Maybe not ideal on the long run but that should allow you to continue working on your project most quickly.

Marco N.
  • 185
  • 2
  • 8
  • in that way it's work ,but i need to add jars through maven. – honey1 Apr 15 '16 at 13:23
  • Well, I do not really get what you mean. On e.g. Maven Central you will nearly always get code snippets like ` org.springframework spring-webmvc 4.2.5.RELEASE ` (do not know whether this is the version you search for but I guess it serves as an example). These snippets you just add to the dependency section of your pom.xml file. Then typically your IDE should download the jars for you (via Maven). – Marco N. Apr 15 '16 at 20:51
0

For some reason, Eclipse did not fetch the index from MavenCentral. Go to the "Maven repositories" view and click on "central" in "Global Repositories". You probably do not see elements in it. Make a right click and check whether the index is enabled. If it is, try "update". An update of central may take 30 minutes or more.

If none of this works (which is quite possible), throw away your local repository (in the .m2 folder in your home directory) and retry everything. Local repositories are sometimes broken.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
0

In eclipse go to Window -> Preferences -> Maven enter image description here

Then go to Window > Show View > Other > Maven > Maven Repositories Click on "Full Index Enabled" and then click on "Rebuild index" as shown below

enter image description here

akshay
  • 135
  • 1
  • 7