This page provides information for JBoss Community users to get started with the JBoss.org Maven repository.
If you are new to Maven, you may want to first go to the Apache Maven site (http://maven.apache.org/) to learn the basics. If you are already familiar with Maven, and want to learn how to use the JBoss Maven repositories and download JBoss artifacts in your builds, you are in the right place.
Using JBoss Artifacts
The "public-jboss" repository group provides a combined view of all JBoss community project artifacts (with a few exceptions).
https://repository.jboss.org/nexus/content/groups/public-jboss/
This repository URL can be added to your Maven settings.xml file, or to your POM to allow your build to use JBoss artifacts. If you need more fine grained access to JBoss artifacts, for example you want only releases and no snapshots you can use the direct URL to the releases repository.
https://repository.jboss.org/nexus/content/repositories/releases/
The wiki page Maven Repository provides more detailed information about each repository available at repository.jboss.org.
Using the Repository Web Interface
The web interface is available at https://repository.jboss.org/nexus and it available to all users. The web interface displays all the available repositories and their relevant URLs. This interface also provides the ability to search for and locate artifacts in the repository.
Configuring Maven to use the JBoss Repository
The repository has a single repository group URL that can be used to download artifacts from multiple repositories.
https://repository.jboss.org/nexus/content/groups/public-jboss/
To use dependencies from the jboss.org repository this URL will need to be added to your Maven settings. Maven includes a default settings.xml file located in $MAVEN_HOME/conf/settings.xml and also looks for a user settings file located in $HOME/.m2 (more about Maven settings). It is recommended that you not modify the default Maven settings file. Instead, you should copy the default settings.xml file to your .m2 directory and make modifications to this new file. A complete example is also available (Maven Settings Example - Users). The following snippet (or something similar) should be included in the user settings.xml to use the JBoss repository.
... ... jboss-public-repository jboss-public-repository-group JBoss Public Maven Repository Group https://repository.jboss.org/nexus/content/groups/public-jboss/ default true never true never jboss-public-repository-group JBoss Public Maven Repository Group https://repository.jboss.org/nexus/content/groups/public-jboss/ default true never true never jboss-public-repository ...
This will add the JBoss repository to a profile which will be active by default during your builds. As long as the profile is active, your Maven build will be able to download dependencies from the JBoss repository. If you want to deactivate this profile for a specific build (to avoid using the JBoss repository), this can be done using the standard Maven command line syntax for deactivating a profile.
mvn -Pjboss-public-repository install
For a detailed description of the options available in the Maven settings, see the Maven settings reference.
Using Deprecated Dependencies
The JBoss Maven repository restructured in April 2010 to provide a cleaner better organized repository. As a result, many artifacts have been moved into a deprecated Maven repository and should no longer be used. If your build requires a dependency that can only be found in the deprecated repository, you should notify the project team. To use the deprecated artifacts, simply add an additional profile to your settings.
jboss-deprecated-repository jboss-deprecated-repository JBoss Deprecated Maven Repository https://repository.jboss.org/nexus/content/repositories/deprecated/ default true never false never
Using JBoss Maven Plugins
Several JBoss projects include Maven plugins. Optionally, you can add configuration to your settings.xml which will allow Maven to use shorthand notation for jboss plugins.
org.jboss.maven.plugins
Example
A complete example of settings.xml is also available ( Maven Settings Example - Users ).
Questions/Problems
If you have issues using the suggested repository configuration, please post your questions to the build forum ( http://community.jboss.org/en/build?view=discussions ), or ask for help on IRC ( #jboss at irc.freenode.net )
Comments