1.4. Install JBoss AS Quickstarts

Overview

The JBoss AS Quickstart examples consists of a collection of demonstrations that illustrate features of the JBoss Enterprise Application Platform. The installation consists of the following parts:
  • JBoss EAP Maven repository—an offline Maven repository for JBoss Enterprise Application Platform, which contains the dependencies required by the quickstart examples.
  • JBoss AS Quickstart examples—the quickstart examples themselves.

Prerequisites

To download, install, and build the JBoss AS Quickstart examples, you need the following prerequisites:
  • Subscription—you must have a Red Hat subscription that includes support for the JBoss Enterprise Application Platform product (or ask Red Hat support for access as part of an evaluation).
  • Maven installation—you must have Apache Maven installed and the version must be 3.0.0 or later. You can get the latest copy of Maven from the Maven download page.
  • Internet access—Maven is a distributed build system, which downloads packages from the Internet on the fly, whenever they are needed during a build. Consequently, you must have access to the Internet while performing a Maven build.

JBoss AS Quickstarts download location

You can download the JBoss AS Quickstart examples from the Quickstarts download page on the Red Hat Customer Portal site. Click the following link to download the jboss-eap-6.1.0-quickstarts.zip file:
Note
After following this link, you will be prompted to log on to the Red Hat customer access portal. If you do not have a subscription for JBoss Enterprise Application Platform, you will not be able to access this download, however.

Maven repository download location

The JBoss Enterprise Application Platform Maven repository is required in order to run the quickstart examples.
You can download the Maven repository from the Maven Repository download page on the Red Hat Customer Portal site. Click the following link to download the jboss-eap-6.1.0-maven-repository.zip file:

Steps to install JBoss AS Quickstarts

To install the JBoss AS Quickstart examples, perform the following steps:
  1. Download the jboss-eap-6.1.0-quickstarts.zip file from the customer portal site. Use an archive utility to unzip the downloaded file at a convenient location on your filesystem, QuickInstallDir.
  2. Download the jboss-eap-6.1.0-maven-repository.zip file from the customer portal site. Use an archive utility to unzip the downloaded file at a convenient location on your filesystem, MvnRepoInstallDir.
    Note
    It is essential to download and install the Maven repository on your local machine. The quickstart examples require Maven artifacts that are not available from any public repositories online. You will not be able to build the quickstart examples unless you download, install, and configure the Maven repository.
  3. Configure Maven to use the downloaded Maven repository by editing your local repository's settings.xml file (usually located at ~/.m2/settings.xml on Linux and UNIX systems, or at C:\Documents and Settings\Username\.m2\settings.xml on Windows). Open the settings.xml file with a text editor and add the following profiles:
    <?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>
    
        <!-- Configure the JBoss EAP Maven repository -->
        <profile>
          <id>jboss-eap-repository</id>
          <repositories>
            <repository>
              <id>jboss-eap-repository</id>
              <url>file:///path/to/jboss-eap-6.1.0.GA-maven-repository</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
            </repository>
          </repositories>
          <pluginRepositories>
            <pluginRepository>
              <id>jboss-eap-plugin-repository</id>
              <url>file:///path/to/jboss-eap-6.1.0.GA-maven-repository</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
            </pluginRepository>
          </pluginRepositories>
        </profile>
    
        <!-- Configure the JBoss Community Maven repository -->
        <profile>
          <id>jboss-community-repository</id>
          <repositories>
            <repository>
              <id>jboss-community-repository</id>
              <url>http://repository.jboss.org/nexus/content/groups/public/</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
            </repository>
          </repositories>
          <pluginRepositories>
            <pluginRepository>
              <id>jboss-community-plugin-repository</id>
              <url>http://repository.jboss.org/nexus/content/groups/public/</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
            </pluginRepository>
          </pluginRepositories>
        </profile>
    
      </profiles>
    
      <activeProfiles>
        <!-- Optionally, make the repositories active by default -->
        <activeProfile>jboss-eap-repository</activeProfile>
        <activeProfile>jboss-community-repository</activeProfile>
      </activeProfiles>
    
    </settings>
    Note
    Alternatively, there is a sample settings file provided at MvnRepoInstallDir/example-settings.xml in the downloaded Maven repository, which you can use as a template for defining your settings.xml file.
  4. Replace all occurrences of file:///path/to/jboss-eap-6.1.0.GA-maven-repository in the settings.xml file with the actual location of the Maven repository on your filesystem, MvnRepoInstallDir.

Test the installation

To test the installation of the quickstart examples, try to build the helloworld-mdb example using Maven. Open a new command window, change directory to QuickInstallDir/helloworld-mdb, and enter the following command:
mvn clean package
If the project builds successfully, you should see a BUILD SUCCESS status and the generated jboss-as-helloworld-mdb.war package will be found under the QuickInstallDir/target directory.
If the project does not build successfully, make sure that you have access to the Internet and check that the Maven settings.xml file is correctly configured.