[jboss-user] [jBPM] - jBPM4 Building from Source

Administrator Administrator do-not-reply at jboss.com
Thu Jan 20 11:10:49 EST 2011


Administrator Administrator [http://community.jboss.org/people/admin] modified the document:

"jBPM4 Building from Source"

To view the document, visit: http://community.jboss.org/docs/DOC-12867

--------------------------------------------------------------
This page explains how to get the jbpm 4 process engine sources, the various things you can build with it and how to set up your eclipse.
h1. Requirements
* JDK 5 or higher
* Maven 2.0.9 or higher
* Subversion
h1. Other build instructions
*  http://community.jboss.org/docs/DOC-13343 Google Summer of Code 2010
*  http://community.jboss.org/docs/DOC-13342 Jbpm4BuildConsoleFromSources
h1. Getting the sources
Perform anonymous checkout of the sources like this:
svn co http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk jbpm4
jBPM developers should check out the sources using the following url
svn co https://svn.jboss.org/repos/jbpm/jbpm4/trunk jbpm4
h1. Building the default modules
To build the default modules run:
[jbpm4]$ mvn clean install

Before you commit, first do an update and then this command should run OK with your updates.

A successfull build/test run ends like this:
[INFO] ------------------------------------------------------------------------
 [INFO] Reactor Summary:
 [INFO] ------------------------------------------------------------------------
 [INFO] jBPM 4 ................................................ SUCCESS [7.812s]
 [INFO] jBPM 4 - API .......................................... SUCCESS [11.844s]
 [INFO] jBPM 4 - Log .......................................... SUCCESS [1.281s]
 [INFO] jBPM 4 - Test Base .................................... SUCCESS [1.110s]
 [INFO] jBPM 4 - PVM .......................................... SUCCESS [24.953s]
 [INFO] jBPM 4 - Task ......................................... SUCCESS [6.937s]
 [INFO] jBPM 4 - jPDL ......................................... SUCCESS [3.438s]
 [INFO] jBPM 4 - Examples ..................................... SUCCESS [10.047s]
 [INFO] jBPM 4 - Enterprise ................................... SUCCESS [6.359s]
 [INFO] jBPM 4 - Test DB ...................................... SUCCESS [10.922s]
 [INFO] jBPM 4 - Test POJO .................................... SUCCESS [3.109s]
 [INFO] ------------------------------------------------------------------------
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD SUCCESSFUL
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 1 minute 28 seconds
 [INFO] Finished at: Fri Jan 16 13:45:35 CET 2009
 [INFO] Final Memory: 22M/45M
 [INFO] ------------------------------------------------------------------------
h1. Building the distribution
If you're running outside the Red Hat VPN (only employees have it) you'll have to fetch the oracle driver yourself as we're not allowed to redistribute it in our public repositories.

Download the oracle ojdbc14.jar driver here:  http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html

Then install the oracle driver into your local repository like this
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.1.0.5 -Dpackaging=jar -Dfile=path/to/file

To build the distribution,
[jbpm4]$ mvn -Pdistro clean install

In case you are working outside the Red Hat VPN and downloaded a different version of the Oracle driver, build the distribution as follows.
[jbpm4]$ mvn -Pdistro -Doracle.version=10.1.0.5 clean install

After that finishes successfully, you'll find the distribution package in modules/distro/target/jbpm-{version}.zip
On windows you can add the schemadocs profile with *-Pschemadocs*. In other operating systems, the schema docs generation fails.

The distribution package is also published in the repository.  (note that it's called jbpm-distro-{version}.zip in the repo)
h1. Build scripts
h4. Developer configuration
In the following build files, configurable properties can be customized in file *${user.home}/.jbpm4/build.properties*

As a developer, at least you need to specify *jbpm.parent.dir*  Typically you also want to specify the *jboss.distro.dir* and the *eclipse.distro.dir*
jbpm.parent.dir=${user.home}/jbpm
jboss.distro.dir=${user.home}/downloads/jboss
eclipse.distro.dir=${user.home}/downloads/eclipse

JDBC properties can also be specified in files *${user.home}/.jbpm4/jdbc/${database}.properties*

Or properties can also be provided on the command line like:

ant -Djbpm.parent.dir=/usr/jbpmbuild reinstall.jbpm
h4. Default values
Here are the configurable properties and their default values as used throughout the scripts.
<property name="database" value="hsqldb" />
<property name="jbpm.version" value="4.0.0-SNAPSHOT" />
<property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" />
<property name="jbpm.filename" value="jbpm-distro-${jbpm.version}.zip" />
<property name="jbpm.distro.dir" value="../modules/distro/target" />
<property name="jbpm.distro.path" value="${jbpm.distro.dir}/jbpm-${jbpm.version}.zip" />
<property name="jboss.version" value="5.0.0.GA" />
<property name="jboss.distro.dir" value="${jbpm.home}/downloads" />
<property name="jboss.parent.dir" value="${jbpm.home}" />
<property name="jboss.version" value="5.0.0.GA" />
<property name="jboss.filename" value="jboss-${jboss.version}.zip" />
<property name="jboss.distro.dir" value="${jbpm.home}/downloads" />
<property name="jboss.distro.filename" value="jboss-${jboss.version}.zip" />
<property name="jboss.distro.path" value="${jboss.distro.dir}/${jboss.filename}" />
<property name="jboss.distro.url" value="http://downloads.sourceforge.net/jboss/${jboss.distro.filename}" />
<property name="jboss.home" value="${jboss.parent.dir}/jboss-${jboss.version}" />
<property name="jboss.server.configuration" value="default" />
<property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
<property name="eclipse.filename" value="eclipse-jee-ganymede-SR2-win32.zip" />
<property name="eclipse.distro.url" value="http://mirror.cc.vt.edu/pub/eclipse/technology/epp/downloads/release/ganymede/SR2/${eclipse.filename}" />
<property name="eclipse.distro.dir"  value="${jbpm.home}/downloads" />
<property name="eclipse.parent.dir" value="${jbpm.home}" />
<property name="eclipse.distro.path" value="${eclipse.distro.dir}/${eclipse.filename}" />
h4. qa/build.xml
This is the build script to install jBPM and the helper scripts to drive the continuous integration.   This script is only available in the sources. Other scripts will also be available in the distribution, but this script is not.
[jbpm4/qa]$ ant -p
Buildfile: build.xml
     [echo] database.......... hsqldb
     [echo] jbpm.version...... 4.4-SNAPSHOT
     [echo] jbpm.home......... /home/aguizar/jbpm/jbpm-4.4-SNAPSHOT
     [echo] jbpm.distro.path.. ../modules/distro/target/jbpm-4.4-SNAPSHOT.zip

Main targets:

 internal.enterprise.test.setup.base   reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema
 reinstall.jbpm                        deletes the jbpm installation and then reinstalls jbpm
 testsuite.enterprise.setup            reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema
 testsuite.enterprise.setup.for.debug  reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema
 testsuite.enterprise.teardown         drops the jbpm schema and stops jboss
 testsuite.jboss.setup                 reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema
 testsuite.jboss.setup.for.debug       reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema
 testsuite.jboss.teardown              drops the jbpm schema and stops jboss

h4. distro/src/main/files/install/build.xml
This script contains the targets related to installing jboss, installing jbpm into jboss and starting and stopping jboss. It also contains the targets related to creating and dropping the db  schema. This script will be part of the distro and also be usable by our users.

[modules/distro/src/main/files/install]$ ant -p
Buildfile: build.xml

Main targets:

 clean.cfg.dir                 Deletes the ${cfg.dest.dir}
 create.cfg                    Creates a configuration in ${cfg.dest.dir}
 create.jbpm.schema            creates the jbpm tables in the database
 create.user.webapp            Generates a configuration in dir /install/generated/user-webapp
 delete.jboss                  Deletes jboss installation
 delete.tomcat                 Deletes tomcat installation
 demo.setup.jboss              installs jboss and jbpm, starts jboss, creates the db schema, deploys examples, loads example identities, installs and starts eclipse
 demo.setup.tomcat             installs tomcat, installs jbpm into tomcat, starts tomcat, creates the jBPM DB schema, deploys examples, loads example identities, installs and starts eclipse
 demo.teardown.jboss           drops the db schema and stops jboss
 demo.teardown.tomcat          stops tomcat and then the hsqldb server if needed
 drop.jbpm.schema              drops the jbpm tables from the database
 get.eclipse                   downloads eclipse to ${eclipse.distro.dir}
 get.jboss                     Downloads jboss into ${jboss.distro.dir}
 get.tomcat                    Downloads tomcat into ${tomcat.distro.dir} if it is not available
 hsqldb.databasemanager        start the hsqldb database manager
 install.eclipse               unzips eclipse, downloads eclipse if it is not available in ${eclipse.distro.dir}
 install.examples.into.tomcat  deploys all the example processes
 install.jboss                 Downloads jboss to ${jboss.distro.dir} if its not available and then unzips jboss
 install.jbpm.into.jboss       Installs jBPM into JBoss
 install.jbpm.into.tomcat      Installs jBPM into tomcat
 install.signavio.into.jboss   installs signavio into jboss
 install.signavio.into.tomcat  installs signavio into tomcat
 install.tomcat                Downloads tomcat to ${tomcat.distro.dir} if its not available and then unzips tomcat
 load.example.identities       loads the example users and groups into the database
 reinstall.jboss               Deletes the previous jboss installation and re-installs jboss
 reinstall.jboss.and.jbpm      Deletes the previous jboss installation and re-installs jboss and installs jbpm in it
 reinstall.tomcat              Deletes the previous tomcat installation and re-installs tomcat
 reinstall.tomcat.and.jbpm     Deletes the previous tomcat installation and re-installs tomcat and installs jbpm in it
 start.eclipse                 starts eclipse
 start.jboss                   starts jboss and waits till jboss is booted, then lets jboss run in the background
 start.tomcat                  Starts Tomcat and waits till it is booted, then lets Tomcat run in the background
 stop.jboss                    signals jboss to stop, but doesn't wait till its finished
 stop.tomcat                   Signals Tomcat to stop, but doesn't wait till its finished
 upgrade.jbpm.schema           Upgrades the jBPM tables in the database to the current version

h4. distro/src/main/files/examples/build.xml
This script contains the target for deploying the examples to the database.  This script will be part of the distro and also be usable by our users.
[modules/distro/src/main/files/examples]$ ant -p
Buildfile: build.xml

Main targets:

Other targets:

 create.and.deploy.examples
 examples.jar
 jbpm.libs.path
 log.properties

h3. Testing against a particular database
[jbpm4]$ mvn -Ddatabase=mysql test
h3. Running the test suites on another JDK
To run the test suite on another JDK, make sure it is the default java in the path.

On windows, you can do this easily by a command like this:
*set PATH=C:\Software\jdk1.6.0_07\bin;%PATH%*

To see what the current configured JDK is, you can check the version like this
*java -version
*
h3. Running the enterprise test suite
[jbpm4]$ mvn -Djboss.bind.address=localhost test
h3. Useful maven command line options
*-DskipTests* will skip execution of the test suite.
*-o* will run the build offline.  Maven will not check the snapshot repositories for updates.  Saves time.
*-U* will force updates of libraries
h3. Setting up your eclipse
You'll need
* Eclipse 3.4,  http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR1/eclipse-jee-ganymede-SR1-win32.zip Eclipse IDE for Java EE Developers (163 MB) 
* SVN plugin  http://subclipse.tigris.org/update_1.4.x http://subclipse.tigris.org/update_1.4.x
* MVN plugin  http://m2eclipse.sonatype.org/update/ http://m2eclipse.sonatype.org/update/

After you checked out the jbpm4/trunk, you do:
* *File* --> *Import...*
* *General* --> *Existing projects into Workspace*
* Select jbpm4/trunk/modules as the root directory
* All the modules with an eclipse project should now appear.  By default, all the checkboxes are checked
* Click '*Finish*'

Eclipse will point to the libraries of your local mvn repository.  To get the libraries there, activate '*Project*' --> '*Update All Maven Dependencies*'

Go to *Window* --> *Preferences* --> *Java* --> *Code Style* --> *Formatter* and import jbpm4/trunk/eclipse/jbpm.profile.xml
--------------------------------------------------------------

Comment by going to Community
[http://community.jboss.org/docs/DOC-12867]

Create a new document in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110120/e3161a29/attachment-0001.html 


More information about the jboss-user mailing list