Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - Maven - Dependencies not getting automatically reflected [duplicate]

I have installed

  • Java 1.7
  • Eclipse Juno
  • From Eclipse Market place have installed - Maven Integration for Eclipse WTP (a.k.a m2e-wtp), m2e-apt, Spring IDE, The Spring Tool Suite™ (STS)
  • Have defined M2_HOME as directory where Maven is installed. PATH updated as %M2_HOME%/bin

I am working on Windows XP.

I am able to create a Maven project but when trying to add Dependencies (select pom.xml - Dependencies - Add) artifactId's "Enter groupId, artifactId or sha1 prefix or pattern" which are inputted are not getting displayed. Say if I input "springframework", it only reflect the jars that installed locally and don't search over the internet. Also if I check Maven Repositories (select by Windows - Show Views - Others - Maven - Maven Repositories), nothing is shown in Global Repositories - central (http://repo.maven.apache.org/maven2).

In case, if I manually put required artifactID in pom.xmland then update maven it downloads the required jars.

I am working on my home computer where I don't have any proxies and has set following in local m2 settings (C:\Documents and Settings\Sandy\.m2\Settings.xml)

Can you please advise, what setting I need to do so that inputted artifact's can be added using add Dependencies option?

Thanks in advance

like image 375
Sandeep Avatar asked Dec 22 '13 22:12

Sandeep


1 Answers

Also if I check Maven Repositories (select by Windows - Show Views - Others - Maven - Maven Repositories), nothing is shown in Global Repositories - central(http://repo.maven.apache.org/maven2).

It is most likely that your central Repository index might never have been updated. To resolve it , Go to Window > Show View > Other > type Maven in filter and select Maven Repositories. In Maven Repositories tab Expand Global Repositories, Right-click on central and Update Index.

The process will initially take about a few minutes depending on the network speed but once its done, the search box will start showing results when-ever you type in the name of any jar

like image 96
Saif Asif Avatar answered Sep 17 '22 23:09

Saif Asif