Qpid Java Build How To has been edited by Steve Vinoski (Dec 01, 2006).

(View changes)

Content:

Build Instructions - General

Check out the source

Firstly, check the source for Qpid java out of our subversion repository:

https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/java

Prerequisites

For the broker code you need JDK 1.5 or later. You should set JAVA_HOME and include the bin directory in your PATH.

Check it's ok by executing java -v !

Build Instructions - Trunk (M2+)

Maven Build System

These details are currently being added

Install Maven 2

Firstly, you need to install Maven 2 from here).

You can find out how to set Maven up by following their quick guide.

Some of the relevant Maven targets (in Maven speak 'lifecycle phases') are as follows:

Phase Description
compile compile the source code of the project
test test the compiled source code using a suitable unit testing framework
install compiles & installs the package into the local repository & generates JAR files
clean cleans up artifacts created by prior builds

You can run the install phase but skip the tests by running:

mvn -Pfastinstall

to specify the fastinstall profile.


Build Qpid Java

To compile & install Qpid, cd into the java directory of your checkout and then:

mvn clean
mvn install

If you wish to build an archive of Qpid for installing somewhere then:

cd distribution
mvn

NB: executing Maven in the distribution directory does NOT force a clean build or a re-JAR, but uses the jars from your repository. You must be sure to execute a clean install in the java directory first to get a clean distribution. Best to check that the jars in your repository are current before building a dist !

Building Project Files

You can build project files for IntelliJ IDEA and Eclipse IDEs by executing the appropriate command in the java directory:

Command Result
mvn idea:idea Builds .ipr and .iml files with appropriate project settings for classpath etc
mvn eclipse:eclipse Builds Eclipse project files with settings

Build Instructions - M1 branch

Ant Build Scripts

Currently the Qpid java project builds using ant.

The ant build system is set up in a modular way, with a top level build script and template for module builds and then a module level build script which inherits from the template.

So, at the top level there are:

File Description
build.xml Top level build file for the project which defines all the build targets
common.xml Common properties used throughout the build system
module.xml Template used by all modules which sets up properties for module builds

Then, in each module subdirectory there is:

File Description
build-module.xml Defines all the module values for template properties

Build targets

The main build targets you are probably interested in are:

Target Description
build Builds all source code for Qpid java
archive Generates all distribution archives for Qpid java

So, if you just want to compile everything you should run the build target in the top level build.xml file.

If you want to build an installable version of Qpid java, run the archive task from the top level build.xml file.

If you want to compile an individual module, simply run the build target from the appropriate build-module.xml e.g. to compile the broker source, simply run the build target in the java/broker/build-module.xml file.

What next ?

If you want to run your built Qpid package, see our Getting Started Guide for details of how to do that.

If you want to run our tests, you can use the ant test or testreport (produces a useful report) targets.

Reply via email to