Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are main/best Maven respositories to use? [closed]

Tags:

maven-2

What are the main/best Maven repositories to use that will include the majority of your open source Java package dependencies.

Also in what order should these be included? Does it matter?

like image 795
Keith Lyall Avatar asked Oct 02 '08 11:10

Keith Lyall


People also ask

Which is the most popular public maven repository?

Containing over three million maven artifacts, Maven Central is one of the world's largest and oldest public repositories. It is the default repository that the maven client contacts when building a maven project.

What are the different types of maven repositories?

There are 3 types of maven repository: Local Repository. Central Repository. Remote Repository.

What is default maven repository?

Maven Central, a.k.a. the Central Repository, is the default repository for Maven, SBT, Leiningen, and many other JVM based build tools. It has been around since 2002, and serves many terabytes of assets every year. Maven Central also has a search site.

Which maven repository is searched first for artifacts?

Central repository Whenever you run build job, maven first try to find dependency from local repository. If it is not there, then, by default, maven will trigger the download from this central repository location.


2 Answers

This is the current setup in the project we are building:

  • MavenCentral
  • ObjectWeb
  • JBoss Maven2
  • and some snapshots (see below)

    <repository>     <id>MavenCentral</id>     <name>Maven repository</name>     <url>http://repo1.maven.org/maven2</url>     <releases>         <enabled>true</enabled>     </releases>     <snapshots>         <enabled>false</enabled>     </snapshots> </repository> <repository>     <id>objectweb</id>     <name>Objectweb repository</name>     <url>http://maven.objectweb.org/maven2</url>     <releases>         <enabled>true</enabled>     </releases>     <snapshots>         <enabled>false</enabled>     </snapshots> </repository> <repository>     <id>jboss</id>     <name>JBoss Maven2 repository</name>     <url>http://repository.jboss.com/maven2/</url>     <snapshots>         <enabled>false</enabled>     </snapshots>     <releases>         <enabled>true</enabled>     </releases> </repository> <repository>     <id>glassfish</id>     <name>Glassfish repository</name>     <url>http://download.java.net/maven/1</url>     <layout>legacy</layout>     <releases>         <enabled>true</enabled>     </releases>     <snapshots>         <enabled>false</enabled>     </snapshots> </repository> <repository>     <id>apache.snapshots</id>     <name>Apache Snapshot Repository</name>     <url>         http://people.apache.org/repo/m2-snapshot-repository     </url>     <releases>         <enabled>false</enabled>     </releases>     <snapshots>         <enabled>true</enabled>     </snapshots> </repository> <repository>     <id>ops4j.repository</id>     <name>OPS4J Repository</name>     <url>http://repository.ops4j.org/maven2</url>     <releases>         <enabled>true</enabled>     </releases>     <snapshots>         <enabled>false</enabled>     </snapshots> </repository> <repository>     <id>Codehaus Snapshots</id>     <url>http://snapshots.repository.codehaus.org/</url>     <snapshots>         <enabled>true</enabled>     </snapshots>     <releases>         <enabled>false</enabled>     </releases> </repository> 
like image 130
Jorge Ferreira Avatar answered Oct 08 '22 20:10

Jorge Ferreira


I would suggest using a Maven proxy like Archiva, Artifactory or Nexus and defining your repo list on the server side. The order matters only to the extent that the proxy server tries the proxied repos one by one and specifying a fringe repository as first will slow down the resolution of uncached artifacts (Artifactory allows you to specify whitelist and blacklist expressions for each proxied repo, which solves this problem)

Overall using your own repo gives you more control and reliable builds ('central' is often painfully slow). It also gives you a place to put your own artifacts and any non-free 3rd party artifacts.

like image 28
ddimitrov Avatar answered Oct 08 '22 21:10

ddimitrov