Friday, August 3, 2007

Adding Repositories to Maven 2

Maven uses on-line repositories to find the dependencies you set in your pom file. By default, maven uses the repository specified in the

If you want to use other repositories, you are able to do so by adding a ~/.m2/settings.xml file. This file should be provided in the following format:


<settings>
<profiles>
<profile>
<id>standard-extra-repos</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>jboss</id>
<url>http://repository.jboss.com/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jboss-snapshot</id>
<url>http://snapshots.jboss.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-plugins</id>
<url>http://repository.jboss.com/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>jboss-snapshot-plugins</id>
<url>http://snapshots.jboss.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>


Some repositories I've collected and you might be interested in using, because some artifacts are available only through some of these repositories and not all of them. It is important to remember that the more repositories you add, the slower will be your build, so use them with wisely.

Repository
http://www.ibiblio.org/
http://download.java.net/maven/2
http://repo1.maven.org/maven2
http://repository.jboss.com/maven2
http://maven.apache.org/
http://mojo.codehaus.org/


Snapshot
http://snapshots.jboss.org/maven2
http://people.apache.org/repo/m2-snapshot-repository
http://snapshots.maven.codehaus.org/maven2
http://snapshots.repository.codehaus.org


If you want to download snapshot version of maven plugins, there is a page which explains how to setup your settings.xml file.

1 comment:

Ram said...

good job ! this helps me a lot

keep up the good work