Install the required tools
Get/use JDK version 1.4 and apache-ant 1.6.2 if you plan on contributing/committing code. This is used by the cruise control server.
Fetch jBPM from CVS
Get module jbpm.3 somewhere on your hard drive.
Here's how we do this (using tcsh, anonymous access):
$ setenv CVSROOT :pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jbpm $ cvs export -D now jbpm.3
Or in zsh, if the above does not work:
$ cvs -d:pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jbpm login $ cvs -z3 -d:pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jbpm co -P jbpm.3
JBPM 3.2 Directory Structure
The JBPM 3.2 tree is based on the same principles as are embodied in the Apache Maven project, though without the actual use of the Maven software to manage builds.
Specifically, the JBPM 3.2 tree is organized around high level "module product" directories (such as console, enterprise, identity, etc.) which may in turn contain a number of buildable deliverables, known as "artifacts". An artifact may be any component that needs to be built in order to deploy the software. JAR, EAR, SAR, and WAR files may all be artifacts.
Here is what is contained in the raw JBPM 3.2 tree, as exported from CVS:
bpel - Optional support module for the Business Process Execution Language
build - main build directory, has xml and properties file.
console - the main web app
designer - Eclipse Designer Package
enterprise - Contains JMS message-driven beans for processing commands from remote clients
identity - the identity management component for jBPM
jboss - 4.0.3 trimmed? version of jboss. (we are using 4.0.4)
jpdl - jBPM Process Definition Language.. the JBPM core.
Start reading the build/readme.html
Clover is only necessary for running the coverage tests.
Prepping For Build
Essentially, building JBPM 3.2 consists of creating a build.properties file in the build directory which specifies a number of pieces that should be customized for the build:
######################################################################### # The first three sections might need customizations on your machine. # INSTALLED SOFTWARE DEPENDENCY PROPERTIES ant.home=/v/site/packages/ant-1.6.2 jboss.home=/v/applications/jbpm/jboss eclipse.home=c:/software/eclipse # REPOSITORY LOCATION PROPERTIES local.repository=/v/applications/jbpm/jbpm-3.2/repository remote.repository=http://repository.jboss.com docbook.support.dir=${local.repository} # BROWSER PROPERTIES windows.browser=C:/Program Files/Internet Explorer/IEXPLORE.EXE macos.browser=/usr/bin/open linux.browser=firefox # The remainder section of this configuration file should # typically not be customized.
We've modified the ant.home, jboss.home, and local.repository properties in this file. You must have eclipse installed in the directory pointed to by eclipse.home.
The most interesting one is the local.repository. The JBPM build system, like Maven, is designed to handle dependencies. This is a good thing, because JBPM has a lot of dependencies. JBPM interacts very closely with the JBoss server, and building JBPM is impossible without having copies of the JBoss jar files at hand to resolve class references.
Once we've set local.repository in the build/build.properties file, we can run an Ant target to pull down all of the pieces necessary to resolve references from within the JBPM software:
Only the first time, you need to run
$ ant install.jbpm.ant
That will copy junit to the ant lib directory for unit testing and clover.jar for coverage testing
$ ant get.dependencies
Should be run before each build.
This will create and populate the repository directory with the necessary support libraries:
$ l ${JBPM_3.2_SRC}/repository ant-contrib/ apache-fileupload/ beanshell/ eclipse/ hsqldb/ jbpm/ mockejb/ antlr/ apache-log4j/ cglib/ ehcache/ httpunit/ jcr/ mockrunner/ apache-beanutils/ apache-logging/ commons-el/ el/ jackrabbit/ junit/ sun-jaf/ apache-collections/ apache-myfaces/ dom4j/ facelets/ jaxen/ jwebunit/ sun-javamail/ apache-digester/ asm/ dumbster/ hibernate/ jbossas/ maven2/ sun-servlet/
Onto the build.
A quick check for the different ant task (ant -p) gives us:
Buildfile: build.xml Main targets: build.bpel builds bpel and all its dependent jbpm subprojects build.jpdl builds jpdl and all its dependent jbpm subprojects clean cleans all subprojects get.dependencies gets all the dependencies. after this target, you should be able to build without a network connection. install.jbpm.ant copies junit and clover jars to the directory ${ant.home}/lib test.jpdl builds and then tests all testable subprojects Default target: build.jpdl
For testing
Use the test.jpdl target in the build/build.xml.
Make sure ant has got enough heap to generate the html test results. Use ANT_OPTS to increase the default heap size. E.g. on windows you can do this with set ANT_OPTS=-Xmx500m
If you want to run the tests with another database then the default hypersonic in memory database, follow these instructions:
Look at directory jpdl/jar/src/test/config in the sources. It contains a template for specifying the database properties to run the tests. To get started, copy this directory to ${user.home}/jbpm/dbtests, so all the database dirs are then located in ${user.home}/jbpm/dbtests/config
Usage is as follows:
1) With ant's -D or in your ${user.home}/jbpm/build.properties specify a config
property ${custom.db.config} and give it a value that corresponds with
one of these database directories.
2) If this property is set, all the contents of that directory will overwrite
the default configurations as in jpdl/jar/src/main/config for the test run
3) Put the driver jar files for the database in
${user.home}/jbpm/dbtests/config/${custom.db.config}/.jar So e.g. the oracle driver jar
file could have the following location: ${user.home}/jbpm/dbtests/config/oracle/classes12.jar
Comments