Skip to end of metadata
Go to start of metadata

Source

Firstly, check out the source from the subversion reporsitory or the git mirror.

Subversion

svn checkout http://svn.apache.org/repos/asf/qpid/java/trunk qpid-java

GIT

git clone git://git.apache.org/qpid-java.git qpid-java

Prerequisites

Java

The build requires a JDK version of 1.7.0 or later. You should set the JAVA_HOME environment variable and include its bin directory in your PATH.

Check it's OK by executing the following at your command prompt.

java -version

Maven

The build requires a Maven version of 3.0.0 or later.  You should set the M2_HOME environment variable and include its bin directory in your PATH.

Check it's OK by executing the following at your command prompt.

mvn --version
For full maven install reference visit Maven Installation Instructions.

Qpid Maven Structure

For complete reference and documentation on Maven please visit the following online resources.

Apache Maven Project

Maven: The Complete Reference by Sonatype

Project Object Model (POM)

Each Qpid java module has its own POM file (pom.xml) located in its root directory.

This file defines the modules version, dependencies and project inheritence as well as the configuration of the relative maven plugins specific to this module.  

At present we have 2 high level "parent" modules that serve as the grandparent and parent of all the java modules in the project.

 

POMArtifact NameLocationDescription

Qpid Parent

qpid-parent

NA

This is the high level POM that all Qpid modules ultimately inherit from.  

It itself is a child of the latest Apache parent POM and its main purpose is to initialise all of our default values, plugins and versions and set any global Qpid configuration.

It is versioned separatley and its release cycle is independent of that of the Qpid Java Project.

Java Build

qpid-java-build

pom.xmlThis is the primary build POM that can be used to build the whole Qpid Java project.  It defines all of the Java Qpid modules and sets all the default values, plugins, versions and configuration for the whole Java build.

Child Modules

qpid-*

 **/pom.xml

or

**/**/pom.xml

Each and every child module has its own specific POM file that specifies exactly what its dependencies are and any plugin configuration it needs.

Maven Commands

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

Please visit Introduction To The Maven Lifecycle reference guide for full details on all the maven lifecycle phases.

CommandDescriptionNotes
mvn cleanremoves all the files created by the previous buildUsually means it deletes the contents of the modules */target/ directory.
mvn validatevalidates that the maven poms are all correct and that no config is missingUsefull to run when making build modifications to ensure consistency.
mvn compilecompiles the source code of the projectThis will verify that project dependencies are correct.
mvn testexecutes the unit testsShould not rely on code being packaged or deployed, only unit tests.

mvn package

packages the code into the its distributable formats (jar, war, zip etc)Each pom specifies what the distribution format is, default is POM.
mvn verifyverifies that the packaged code is validThis will run the integration and system tests.
mvn installinstalls the package into the local maven repositoryThis will result in the module being available, locally, as a depedency
mvn deploycopies the final artifacts to the remote maven repository for sharingThis would happen only when modules ready to be shared with other developers or projects
mvn site:stagecreates a staged version of the maven site with all the reports

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

mvn jacoco:reportgenerates the code coverage report for the tests that have been executedTest output appears in the */target/site/jacoco/ directory

Maven Profiles

Maven profiles are used to allow set configuration to be enables easily at the command line using the -P option.

for e.g.

mvn verify -Pjava-mms.0-9-1

Please visit Introduction To Maven Profiles for full details on the use of profiles in a maven build.

Profile NameDescription
java-mms.0-10Test profile to use AMQP 0-10, the Memory Message Store and the Java Broker for system testing
java-mms.0-9-1Test profile to use AMQP 0-9-1, the Memory Message Store and the Java Broker for system testing
java-mms.0-9Test profile to use AMQP 0-9, the Memory Message Store and the Java Broker for system testing
java-bdb.0-10Test profile to use AMQP 0-10, the BDB Message Store and the Java Broker for system testing
java-bdb.0-9-1Test profile to use AMQP 0-9-1, the BDB Message Store and the Java Broker for system testing
java-bdb.0-9Test profile to use AMQP 0-9, the BDB Message Store and the Java Broker for system testing
java-dby-mem.0-10Test profile to use AMQP 0-10, the Derby In-Memory Message Store and the Java Broker for system testing
java-dby-mem.0-9-1Test profile to use AMQP 0-9-1, the Derby In-Memory Message Store and the Java Broker for system testing
java-dby-mem.0-9Test profile to use AMQP 0-9, the Derby In-Memory Message Store and the Java Broker for system testing
java-dby.0-10Test profile to use AMQP 0-10, the Derby Message Store and the Java Broker for system testing
java-dby.0-9-1Test profile to use AMQP 0-9-1, the Derby Message Store and the Java Broker for system testing
java-dby.0-9Test profile to use AMQP 0-9, the Derby Message Store and the Java Broker for system testing
java-json.0-9-1Test profile to use AMQP 0-9-1, the Json Configuration Store Derby Message Store and the Java Broker for system testing
java-json.0-10Test profile to use AMQP 0-10, the Json Configuration Store Derby Message Store and the Java Broker for system testing
cppTest profile to use AMQP 0-10 and the C++ for system testing
apache-releaseRelease profile for performing Apache software releases
dependency-checkDependency check to validate project licensing ahead of release

Configuring Eclipse

In order to allow your maven project to be viewed/edited in Eclipse IDE use the following commands to generate the IDE config files (*.classpath, .settings etc):

mvn eclipse:eclipse

and the following to delete the IDE config files:

mvn eclipse:clean

and this command to setup your workspace to use your maven repo:

mvn eclipse:configure-workspace -Dworkspace=/path/to/qpid/workspace

Please see the Maven Eclipse Plugin site for full details of this plugin.

Maven Build Output

By default the build output for a maven module will appear in the modules "target" directory:

for e.g. the broker core module output appears in:

broker-core/target

Depending on the goals specified in the last build, one or all of the following can be found in the "target" directory.

LocationDescriptionNotes
*/target/Packaged build artifactsJAR, WAS, ZIP etc as well as any release specific artifacts specified in assembly files i.e. release tars
*/target/surefire-reports/Output from surefire plugin test runsTest config XML files and test result output TXT files
*/target/qpid-broker/${project.version}/qbtc-output/System test broker outputLegacy broker output for the system tests
*/taget/site/Maven site outputMaven reports generated in HTML format i.e. test reports, code coverage etc
*/target/staging/The staged maven siteLocal attempt to generate the full maven site

The releaseable Client and Broker binary packages can be found in the following locations locally if required for testing.

Broker

broker/target/qpid-broker-VERSION-bin.tar.gz

Once you have this then follow the Java Broker installation instructions.

Client

client/target/qpid-client-VERSION-bin.tar.gz

Once you have this then refer to the JMS client documentation.

Example Maven Commands

Here are some example Maven build commands that you may find usefull.

Clean previous builds output and install all modules to local repository without running any of the unit or system tests.

mvn clean install -DskipTests

Clean previous builds output and installs all modules to the local repository after running all the tests using the Java BDB 0-10 profile

mvn clean install -Pjava-bdb.0-10

Perform a subset of the QA (int or sys tests) on the packaged release artifacts

mvn verify -Dtest=TestNamePattern* -DfailIfNoTests=false

Execute the unit tests and then produce the code coverage report

mvn test jacoco:report
  • No labels