3.3. Configure Maven to Use the Repository

For Maven to use the JBoss Web Framework Kit Maven repository, you must configure the Maven configuration settings.xml file. There are two options available for configuring this file: manually using a text editor or automatically using JBoss Developer Studio. Both methods are detailed in the following sections.
A sample Maven configuration file, example-settings.xml, is provided in the JBoss Web Framework Kit Maven repository .zip file demonstrating the JBoss EAP and JBoss Web Framework Kit Maven repository declarations. The repository URLs must be specified in the configuration file <url> fields and vary depending on the type of Maven repository management system in use. The table below gives example URLs for the JBoss Web Framework Kit Maven repository for various Maven repository management systems.

Table 3.1. Example URLs for Maven Repository Management Systems

Maven Repository Management System Example URL
Local file system file:///home/user/projects/maven-repositories/jboss-wfk-maven-repository/
Apache Web Server http://intra.acme.com/maven-repositories/jboss-wfk-maven-repository/
Nexus Repository Manager https://intra.acme.com/nexus/content/repositories/jboss-wfk-maven-repository/

3.3.1. Configure Maven Manually

You can opt to configure your system to use the JBoss Web Framework Kit Maven repository by editing the Maven configuration settings.xml file manually using a text editor, as detailed in the procedure below. Depending on your Maven setup, the settings.xml file may be unique to each user or shared by multiple users.

Procedure 3.2. Configure the Maven settings.xml File Manually

  1. Open the Maven settings.xml file in a text editor.
  2. Open the provided /path/to/jboss-wfk-maven-repository/example-settings.xml for viewing.
  3. Copy the JBoss Web Framework Kit <profile> and <activeProfile> sections from the example-settings.xml file to the settings.xml file.
  4. Replace the placeholder <url> text with the path to the JBoss Web Framework Kit Maven repository installation.
  5. Save and close the settings.xml file.

3.3.2. Configure Maven in JBoss Developer Studio

JBoss Developer Studio provides actions for automatically configuring your Maven setting.xml file for the JBoss Web Framework Kit Maven repository, as detailed in the procedure below.

Note

By default, JBoss Developer Studio expects the Maven configuration settings.xml file to be in a user's .m2 directory. If you are using a settings.xml file located elsewhere, change the IDE Maven settings in Preferences under MavenUser Settings before starting this procedure.

Procedure 3.3. Configure Maven in JBoss Developer Studio

  1. In JBoss Developer Studio, click WindowPreferences, expand JBoss Tools and select JBoss Maven Integration.
  2. Click Configure Maven Repositories.
  3. Click Add Repository.
  4. Click Recognize JBoss Maven Enterprise Repositories.
  5. Navigate to path/to/jboss-wfk-maven-repository and click OK. JBoss Maven Tools recursively scans the path searching for the Maven repository. Once found, the fields in the Add Maven Repository wizard are automatically complete.
  6. Modify the information in the ID and Name fields as desired, ensure the Active by default check box is selected and click OK.
  7. Click Finish and at the prompt asking if you are sure you want to update the Maven configuration file click Yes. If the specified configuration file does not exist, JBoss Maven Tools creates it.
  8. Click Apply and click OK to close the Preferences window.