Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven central Repository: issue with Eclipse

 
Francesco Bellini
Ranch Hand
Posts: 38
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I use maven with Eclipse Juno and I've noticed that the Maven Repository tab doesn't show the content of Global Repositories -> Central if expanded.
Usually, the repositories can be browsed, but it seems that the default one (and I don't understand where it is defined) not.
Here's the picture:


So, I've added the following piece of XML code in my .m2/settings.xml:

The repository above can be "expanded" in the Maven repository browser within Eclipse.

My question is: where the default Central Maven repository is defined? I've searched in the settings.xml within the maven installation directory (on Windows 7) but I don't see any http://repo.maven.apache.org/maven2 occurrency in it.
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All POMs inherit from a Super POM. The Super POM is somewhere inside Maven (I have never found it.. possibly packaged inside one of the maven jars). The Super POM contains the central maven repo.
 
Francesco Bellini
Ranch Hand
Posts: 38
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information. I was actually wandering if there wouldn't be some URL hard coded in the maven sources. And that's it.
Well, and why is such repository not expandable within the Eclipse Maven repository tree tab?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maven Central is not browsable (it used to be ages ago...), hence the reason why it will not expand in Eclipse. If you go to Maven Central (in a browser), you will be redirected to a search facility. However, for most contexts you can still access Maven Central directly (I do it all the time).
 
Francesco Bellini
Ranch Hand
Posts: 38
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good to know! And by the way is http://repo1.maven.org/maven2 a good maven central repository alternative or not? Sometimes I get missing artifact when trying to add dependencies, but it may be due to the version I am choosing at that moment.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I think that repo1.maven.org/maven2 is the default repository hard-coded into Maven.

However, as Peter noted, browsing this repository via a web browser isn't what it used to be.
 
Francesco Bellini
Ranch Hand
Posts: 38
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, this is the default repository hard-coded into Maven: http://repo.maven.apache.org/maven2.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I get a missing version, I usually browse Maven Central to see what is available. At times the version number is declared but only a POM is present, no JAR, in which case I revert to an earlier version.

In my dev environment we use Nexus and have several repository proxies defined and usually the problem I run into is some of the other proxied repositories defining stupid version numbers that don't have JAR files (I won't name any names but a certain Linux company whose name is associated with headgear and which owns a certain application server has oddly-versioned copies of various artifacts which always mess up my dependency version ranges. Ticks me off to no end. Unfortunately we need to include their Frankenstinian repository because some of our projects need JARs available only there.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic