Build Instructions

Quick Start Guide only gives a minimum set of instructions to start quickly building and developing Qpid Broker-J code. The materials provided here intend to give a deeper understanding of various options for building, and testing Qpid Broker-J.

Changes need to be committed into Apache Git repository. They immediately get propagated into GitHub mirror. Only members of Qpid project with commit rights can commit the changes. The contributors without commit rights need to raise Pull Request on GitHub in order to have their changes be committed by Qpid project committers.

Java

The build requires a Java 8 or later. You should set the JAVA_HOME environment variable and include its bin directory in your PATH.

Check java version by executing the following at your command prompt.

java -version

Project structure

Qpid Broker-J consists of a number of modules and sub-modules located in their own directories. Each Qpid Broker-J module has its own POM file (pom.xml) located in its root directory. This file defines the modules version, dependencies and project inheritance as well as the configuration of the relative maven plugins specific to this module. The Qpid Broker-J parent pom.xml is located in the root of the project and declares all qpid modules, dependencies, plugins, etc.

Building

The project is built by executing maven command in conjunction with pre-defined profiles. For example, the command below cleans previous build output and install all modules to local repository without running the tests:

mvn clean install -DskipTests

The following command installs all modules to the local repository after running all the tests:

mvn clean install

Maven Commands

Here is a quick reference guide outlining some of the maven commands you can run and what the outcome will be.

Usually means it deletes the contents of the modules */target/ directory.

mvn validate

validates that the maven poms are all correct and that no config is missing

Useful to run when making build modifications to ensure consistency.

mvn compile

compiles the source code of the project

This will verify that project dependencies are correct.

mvn test

executes the unit tests

Should not rely on code being packaged or deployed, only unit tests.

mvn package

packages the code into the its distributable formats (jar, zip etc)

Each pom specifies what the distribution format is, default is POM.

mvn verify

verifies that the packaged code is valid

This will run the integration and system tests.

mvn install

installs the package into the local maven repository

This will result in the module being available, locally, as a depedency

mvn deploy

copies the final artifacts to the remote maven repository for sharing

This would happen only when modules ready to be shared with other developers or projects

mvn site:stage

creates a staged version of the maven site with all the reports

Staging output defaults to the */target/staging/ directory

mvn jacoco:report

generates the code coverage report for the tests that have been executed

Test output appears in the */target/site/jacoco/ directory

Maven Profiles

Maven profiles are used to run tests for the supported protocols and storage options. The specific profile can be enabled at the command line using option -P. If no profile is selected, java-mms.1-0 is run by default.

Distribution bundles

Running tests

Integration tests except for protocol tests are disabled by default. In order to run all integration tests, they need to be enabled with a flag -DskipITs=false, for example

mvn verify -DskipITs=false

Running all integration tests using BDB and AMQP 1.0 protocol:

mvn verify -Pjava-bdb.1-0 -DskipITs=false

Perform a subset of tests on the packaged release artifacts without installing:

mvn verify -Dtest=TestNamePattern* -DfailIfNoTests=false

Execute the tests and produce code coverage report:

mvn clean test jacoco:report

Joram JMS Testsuite

The Joram JMS Testsuite is integrated into the Maven build but is disabled by default. It allows the Joram JMS test suite to be executed using the specified Qpid JMS client against Qpid Broker-J. The Broker must be running already.

JMS TCK

The configuration for the JMS TCK is integrated into the Maven build but the profile is disabled by default. The JMS TCK itself is proprietary and must be provided by the user. The Broker must be running and HTTP management available. The test suite will automatically set-up/teardown the JMS objects required by the TCK.

qpid-jms-client - Qpid JMS Client for AMQP 1.0

jms-client - Legacy Qpid JMS Client for AMQP 0-x

To use the test suite, first unpack the JMS TCK into a directory, then invoke tests in the following way:

Performance Tests

The Performance test suite is integrated into Maven. It is bound to the integration-test phase and it is activated by the perftest system property. The Broker must be running and HTTP management available. The test suite will automatically set-up/teardown the JMS objects required for the performance tests.

The following clients are supported:

qpid-jms-client - Qpid JMS Client for AMQP 1.0

jms-client - Legacy Qpid JMS Client for AMQP 0-x

To invoke:

mvn -f perftests/pom.xml integration-test -Dperftests=jms-client-0-9

Most things can be overridden from system properties. Take a look in the first few lines of the POM.

Python Tests

The Python Test suite runs against the Qpid Broker-J too but is not currently integrated into Maven. To run the 0-8..0-10 test suites use the following steps. It assumes that qpid-python and qpid-cpp are checked out.

Configure the Qpid Broker-J to allow so that the authentication provider permits plain connections.