6

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

Sandeep
  • 397
  • 3
  • 8
  • 25
  • 1
    in settings.xml check if false is there. – dev Dec 23 '13 at 05:10
  • You have to activate the index download in Eclipse (Preferences -> Maven -> Download Index). The first time it takes a time. – khmarbaise Dec 23 '13 at 07:37
  • @Purnendu, offline is not set on my PC. Following is from local/setting.xml – Sandeep Dec 23 '13 at 19:26
  • @khmarbaise: Sorry, I didn't found this option in Eclipse. Did I misunderstood something? – Sandeep Dec 23 '13 at 20:26
  • BTW: Why are you working with such an old Eclispe version why not Keppler? – khmarbaise Dec 23 '13 at 20:46
  • @khmarbaise: Thanks for that. I didn't realized same. Will check these setting in Keppler and will come back!! Hope it should be version issue as writing programs in Spring MVC is taking lot of time for me due to this! – Sandeep Dec 23 '13 at 22:14
  • @khmarbaise: I installed Keppler but no luck. Still its same. Any further advise? – Sandeep Dec 23 '13 at 23:23

3 Answers3

6

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

Saif Asif
  • 5,516
  • 3
  • 31
  • 48
  • Please note, that this process could take more than just a "few" minutes ;) – Adrian Dec 23 '13 at 07:47
  • sometimes, yes ! I remember my initial update/re-index took about 7-10mins. Actually the size of the file ( the index file ) is approximately around 60MB ( if I remember correctly ). – Saif Asif Dec 23 '13 at 07:51
  • Ui, that's quite small. My indexed file is typically larger than 1GB. Maybe we should cleanup our internal Nexus ;) – Adrian Dec 23 '13 at 07:54
  • your talking about the nexus indexer ? I thought you meant the index file of mvn central. Thats 60MB. Oh and yeah the nexus index files usually count up in GB . You also don't cleanup your nexus? Join the club ;) – Saif Asif Dec 23 '13 at 08:14
  • @SaifAsif - Any message on bar is shown? I Updated the Index and even after 10-15 mins nothing happened!! – Sandeep Dec 23 '13 at 19:37
  • @SaifAsif - Tried couple of times, but is not working. I even uninstalled all Maven and Spring IDE from Maketplace and re-installed it but it didn't helped! Any advise> – Sandeep Dec 23 '13 at 20:24
  • @Sandeep Yes it should show a status bar showing something like downloading/updating maven index. And it should take a couple of minutes. – Saif Asif Dec 24 '13 at 05:26
  • Have fallowed all the steps but still nothing is showing up as I type. – pannu May 17 '17 at 08:46
3

The configuration for Eclipse can be found here:

enter image description here

The screen shot is from Mac OS but also on Windows you will find this under preferences -> Maven.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
1

Finally issue got resolved :) :)

Here what was done:

  • Followed @khmarbaise, @SaifAsif, @Adrian comments :) Thanks for them I was able to understand the overlooked configurations
  • Installed Eclipse Kepler (I was using Eclipse Juno) and Spring IDE from marketplace
  • Maven Download setting as shown by @khmarbaise
  • Copied global setting of maven (f:\maven\conf\settings.xml) to my local setting (C:\Documents and Settings\Sandy.m2). I didn't modified any thing in it.
  • Windows - System environment variables were set
  • M2_HOME - To the local installion (f:\Maven)
  • M2 - %M2_HOME%\bin
  • JAVA_HOME (already exist) - f:\java
  • PATH - %M2%;%JAVA_HOME%\bin
  • CLASSPATH - %JAVA_HOME%

At end I was able to see the dependencies automatically.

Thanks!

Sandeep
  • 397
  • 3
  • 8
  • 25