Appendix B. Maven Configuration Information

B.1. Install the JBoss Enterprise Application Platform Repository Using Nexus

This example outlines the steps to install the JBoss Enterprise Application Platform 7 Maven Repository using Sonatype Nexus Maven Repository Manager. For further instructions, see http://www.sonatype.org/nexus/.

Procedure: Download the JBoss Enterprise Application Platform 7 Maven Repository ZIP archive

  1. Open a web browser and access the following URL: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform.
  2. Find Application Platform 7 Maven Repository in the list.
  3. Click Download to download a ZIP file that contains the repository.
  4. Unzip the files into the desired target directory.

Procedure: Add the JBoss Enterprise Application Platform 7 Maven Repository using Nexus Maven Repository Manager.. Log into Nexus as an Administrator.

  1. Select the Repositories section from the Repositories menu to the left of your repository manager.
  2. Click the Add…​ drop-down menu, then select Hosted Repository.
  3. Provide a name and ID for the new repository.
  4. Enter the unzipped repository path in the Override Local Storage Location field.
  5. Continue if the artifact must be available in a repository group. If not, do not continue with this procedure.
  6. Select the repository group.
  7. Click on the Configure tab.
  8. Drag the new JBoss Maven repository from the Available Repositories list to the Ordered Group Repositories list on the left.

    Note

    The order of this list determines the priority for searching Maven artifacts.

B.2. Maven Repository Configuration Example

A sample Maven repository file named example-settings.xml is available in the root directory of the Maven repository folder after it is unzipped. The following is an excerpt that contains the relevant parts of the example-settings.xml file:

Sample Maven Repository Configuration

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

   <profiles>
      <profile>
         <id>jboss-datagrid-repository</id>
         <repositories>
            <repository>
               <id>jboss-datagrid-repository</id>
               <name>JBoss Data Grid Maven Repository</name>
               <url>JDG_REPOSITORY_URL</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-datagrid-repository</id>
               <name>JBoss Data Grid Maven Repository</name>
               <url>JDG_REPOSITORY_URL</url>
               <layout>default</layout>
               <releases>
                  <enabled>true</enabled>
                  <updatePolicy>never</updatePolicy>
               </releases>
               <snapshots>
                  <enabled>false</enabled>
                  <updatePolicy>never</updatePolicy>
               </snapshots>
            </pluginRepository>
         </pluginRepositories>
      </profile>
   </profiles>
   <activeProfiles>
      <!-- make the profile active by default -->
      <activeProfile>jboss-datagrid-repository</activeProfile>
   </activeProfiles>

</settings>

The JDG_REPOSITORY_URL may be found by following the instructions in Determining the URL of the JBoss Data Grid Repository.

B.3. Determining the URL of the JBoss Data Grid Repository

The repository URL depends on where the repository is located. You can configure Maven to use any of the following repository locations: