Maven 2 links

This document is intended as a quick reference of some of m2 aspects. If you are not yet comfortable with M2 you should check Maven2 guides. There is also a great Maven 2 book: Better Builds with Maven. The book is for free but it requires a registration.

Finding dependencies

There are two sites you may use to find libraries:

You may of course just google for artifact-id site:www.ibiblio.org/maven2 :)

Maven 2 repositories

Maven repository is a HTTP website containing various jars and their descriptors. There are some maven repositories out there:

  • http://repo1.maven.org/maven2/ - the primary Maven2 repository, maintained by the Maven2 crew. Implicitly used by maven 2, you don't have to add it into the settings.xml file.
  • http://www.ibiblio.org/maven2/ - a BIG repository of nearly all java libraries
  • http://maven.sateh.com/repository - a mirror located in Amsterdam, Europe. Quite a fast mirror, I must say
  • http://julien.dubois.free.fr/maven2/ - fearlessly contains some SUN proprietary libraries which cannot be hosted on an official repository
  • http://dist.sourcelabs.com/sash/m2 - contains Eclipse plugins jars
  • delo.dcs repository - an experimental repository hosted on Comenius University Bratislava. Contains libraries developed by the Baka.sk crew, and some eclipse plugins.

    If you are behind a proxy please see this maven proxy guide. You have to put the settings.xml file into $HOME/.m2 directory and add the repository. To add a repository to maven edit the $HOME/.m2/settings.xml file and add the following profiles section:

    <settings>
     
     ...
     
     <profiles>
       <profile>
         <id>default</id>
         <repositories>
           <repository>
             <id>ibiblio</id>
             <name>www.ibiblio.org</name>
             <url>http://www.ibiblio.org/maven2</url>
           </repository>
         </repositories>
    
         <!-- add this to register a plugin repository -->
              <pluginRepositories>
                <pluginRepository>
             <id>baka</id>
             <name>baka.sk</name>
             <url>http://delo.dcs.fmph.uniba.sk/sioux/maven2</url>
           </pluginRepository>
              </pluginRepositories>
       </profile>
     </profiles>
     <activeProfiles>
       <activeProfile>default</activeProfile>
     </activeProfiles>
     
     ...
     
    </settings>

    Please note that the <id> element must not contain characters such as path_separator (/), colon : etc. Try to use alphanumeric characters only.