## Red Hat Training

A Red Hat training course is available for Red Hat AMQ

# Chapter 2. Installation

This chapter guides you through the steps to install AMQ JMS in your environment.

## 2.1. Prerequisites

To begin installation, use your subscription to access AMQ distribution files and repositories.

To compile the examples or your own application, make sure you have Apache Maven installed.

## 2.2. Installing on Red Hat Enterprise Linux

2. Locate the Red Hat AMQ Clients entry in the JBOSS INTEGRATION AND AUTOMATION category.
5. Use the unzip command to extract the file contents into a directory of your choosing.

\$ unzip apache-qpid-jms-<version>.zip
6. Configure Maven to discover the client.

## 2.3. Installing on Microsoft Windows

2. Locate the Red Hat AMQ Clients entry in the JBOSS INTEGRATION AND AUTOMATION category.
5. Extract the file contents into a directory of your choosing by right-clicking on the zip file and selecting Extract All.
6. Configure Maven to discover the client.

## 2.4. Configuring Maven

The client uses Apache Maven as its build tool.

To build and run the client examples, or to use the client in dependent Maven application builds, you must first configure Maven to discover a repository for the client. To do so, you must update or create the Maven settings.xml file. It is typically located at one of the following locations.

Table 2.1. File location

Operating SystemLocation of File

Linux

/home/USERNAME/.m2/settings.xml

Windows

C:\Users\USERNAME\.m2\settings.xml

The client can be accessed by configuring Maven in one of two ways depending on your needs:

1. Using the JBoss Enterprise Maven Repository

The AMQ JMS Client 2.2 can be used from the JBoss Enterprise Maven Repository.

The contents of a settings.xml configured to use the repository would resemble the following example.

<settings>
<profiles>
<!-- Configure the JBoss GA Maven repository -->
<profile>
<id>jboss-ga-repository</id>
<repositories>
<repository>
<id>jboss-ga-repository</id>
<url>https://maven.repository.redhat.com/ga</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-ga-repository</id>
<url>http://maven.repository.redhat.com/ga</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<!-- Configure the JBoss Early Access Maven repository -->
<profile>
<id>jboss-earlyaccess-repository</id>
<repositories>
<repository>
<id>jboss-earlyaccess-repository</id>
<url>https://maven.repository.redhat.com/earlyaccess/all/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<pluginRepositories>
<pluginRepository>
<id>jboss-earlyaccess-repository</id>
<url>http://maven.repository.redhat.com/earlyaccess/all/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</repositories>
</profile>
</profiles>
<activeProfiles>
<!-- Optionally, make the repository active by default -->
<activeProfile>jboss-ga-repository</activeProfile>
<activeProfile>jboss-earlyaccess-repository</activeProfile>
</activeProfiles>
</settings>
2. Using a File-based Maven Repository

Alternatively, you can download the AMQ JMS Client 2.2 Maven Repository zip file from the Red Hat Customer Portal, extract it, and configure Maven to utilize this locally instead.

The contents of a settings.xml configured to use the file-based repository should resemble the following example. Remember to update the URL to the actual path of the extracted repository.

<settings>
<profiles>
<!-- Configure the File Based Maven repository -->
<profile>
<id>amq-jms-client</id>
<repositories>
<repository>
<id>amq-qpid-jms</id>
<url>file:///path/to/extracted/maven-repository</url>
<!-- If using Windows, an example URL might be:
file://C:\path\to\installation\maven-repository  -->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-amq-repository</id>
<url>file:///path/to/extracted/maven-repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!-- Optionally, make the repository active by default -->
<activeProfile>amq-jms-client</activeProfile>
</activeProfiles>
</settings>