Show Table of Contents
2.3.2. Configure the JBoss EAP 6 Maven Repository Using the Maven Settings
There are two approaches to direct Maven to use the JBoss EAP 6 Maven Repository in your project:
This task shows you how to direct Maven to use the JBoss EAP 6 Maven Repository across all projects using the Maven global or user settings. This is the recommended approach.
- You can modify the Maven settings.
- You can configure the project's POM file.
Note
The URL of the repository will depend on where the repository is located; on the filesystem, or web server. For information on how to install the repository, refer to the chapter entitled Maven Guide in the Development Guide for JBoss EAP 6 on https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/. The following are examples for each of the installation options:
- File System
file:///path/to/repo/jboss-eap-6.x-maven-repository- Apache Web Server
http://intranet.acme.com/jboss-eap-6.x-maven-repository/- Nexus Repository Manager
https://intranet.acme.com/nexus/content/repositories/jboss-eap-6.x-maven-repository
You can configure Maven to use the JBoss EAP 6 Repository using either the Maven install or the user install settings. For more information about the location of the settings and how they behave, refer to the chapter entitled Maven Guide in the Development Guide for JBoss EAP 6 on https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/. .
To use the JBoss EAP 6 repository on a local user system, follow these instructions:
Procedure 2.6. Configure the Settings
- Open the
settings.xmlfor the type of configuration you have chosen.Global Settings
If you are configuring theglobalsettings, open theM2_HOME/conf/settings.xmlfile.User Settings
If you are configuring user specific settings and you do not yet have aUSER_HOME/.m2/settings.xmlfile, copy thesettings.xmlfile from theM2_HOME/conf/directory into theUSER_HOME/.m2/directory.
- Copy the following XML into the
<profiles>element of thesettings.xmlfile. Be sure to change the<url>to the actual repository location.<profile> <id>jboss-eap-repository</id> <repositories> <repository> <id>jboss-eap-repository</id> <name>JBoss EAP Maven Repository</name> <url>file:///path/to/repo/jboss-eap-6.x-maven-repository</url> <layout>default</layout> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> <updatePolicy>never</updatePolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-eap-repository-group</id> <name>JBoss EAP Maven Repository</name> <url> file:///path/to/repo/jboss-eap-6.x-maven-repository </url> <layout>default</layout> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> <updatePolicy>never</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> </profile>Copy the following XML into the<activeProfiles>element of thesettings.xmlfile.<activeProfile>jboss-eap-repository</activeProfile>
- If you modify the
settings.xmlfile while JBoss Developer Studio is running, you must refresh the user settings. From the menu, choose → . In the Preferences Window, expand Maven and choose User Settings. Click the button to refresh the Maven user settings in JBoss Developer Studio.
Figure 2.1. Update Maven User Settings
Important
If your Maven repository contains outdated artifacts, you may encounter one of the following Maven error messages when you build or deploy your project:
To resolve the issue, delete the cached version of your local repository to force a download of the latest Maven artifacts. The cached repository is located in your
- Missing artifact ARTIFACT_NAME
- [ERROR] Failed to execute goal on project PROJECT_NAME; Could not resolve dependencies for PROJECT_NAME
~/.m2/repository/ subdirectory on Linux, or the %SystemDrive%\Users\USERNAME\.m2\repository\ subdirectory on Windows.
Result
The JBoss EAP 6 repository has now been configured.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.