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
- Open the Maven
settings.xmlfile in a text editor. - Open the provided
/path/to/jboss-wfk-maven-repository/example-settings.xmlfor viewing. - Copy the JBoss Web Framework Kit
<profile>and<activeProfile>sections from theexample-settings.xmlfile to thesettings.xmlfile. - Replace the placeholder
<url>text with the path to the JBoss Web Framework Kit Maven repository installation. - Save and close the
settings.xmlfile.
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 Maven→User Settings before starting this procedure.
Procedure 3.3. Configure Maven in JBoss Developer Studio
- In JBoss Developer Studio, click →, expand JBoss Tools and select JBoss Maven Integration.
- Click .
- Click .
- Click .
- Navigate to
path/to/jboss-wfk-maven-repositoryand click . 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. - Modify the information in the ID and Name fields as desired, ensure the Active by default check box is selected and click .
- Click and at the prompt asking if you are sure you want to update the Maven configuration file click . If the specified configuration file does not exist, JBoss Maven Tools creates it.
- Click and click to close the Preferences window.