2.3.3. Configure Maven for Use with Red Hat JBoss Developer Studio

The artifacts and dependencies needed to build and deploy applications to Red Hat JBoss Enterprise Application Platform are hosted on a public repository. You must direct Maven to use this repository when you build your applications. This topic covers the steps to configure Maven if you plan to build and deploy application using Red Hat JBoss Developer Studio.
Maven is distributed with Red Hat JBoss Developer Studio, so it is not necessary to install it separately. However, you must configure Maven for use by the Java EE Web Project wizard for deployments to JBoss EAP. The procedure below demonstrates how to configure Maven for use with JBoss EAP by editing the Maven configuration file from within Red Hat JBoss Developer Studio.

Procedure 2.10. Configure Maven in Red Hat JBoss Developer Studio

  1. Click WindowPreferences, expand JBoss Tools and select JBoss Maven Integration.
    Click Window→Preferences, expand JBoss Tools and select JBoss Maven Integration.

    Figure 2.2. JBoss Maven Integration Pane in the Preferences Window

  2. Click Configure Maven Repositories.
  3. Click Add Repository to configure the JBoss GA Tech Preview Maven repository. Complete the Add Maven Repository dialog as follows:
    1. Set the Profile ID, Repository ID, and Repository Name values to jboss-ga-repository.
    2. Set the Repository URL value to http://maven.repository.redhat.com/techpreview/all.
    3. Click the Active by default checkbox to enable the Maven repository.
    4. Click OK
    Enter Maven profile and repository values.

    Figure 2.3. Add Maven Repository - JBoss Tech Preview

  4. Click Add Repository to configure the JBoss Early Access Maven repository. Complete the Add Maven Repository dialog as follows:
    1. Set the Profile ID, Repository ID, and Repository Name values to jboss-earlyaccess-repository.
    2. Set the Repository URL value to http://maven.repository.redhat.com/earlyaccess/all/.
    3. Click the Active by default checkbox to enable the Maven repository.
    4. Click OK
    Enter Maven profile and repository values.

    Figure 2.4. Add Maven Repository - JBoss Early Access

  5. Review the repositories and click Finish.
    Review Maven profile and repository values.

    Figure 2.5. Review Maven Repositories

  6. You are prompted with the message "Are you sure you want to update the file 'MAVEN_HOME/settings.xml'?". Click Yes to update the settings. Click OK to close the dialog.
    The JBoss EAP Maven repository is now configured for use with Red Hat JBoss Developer Studio.