<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
jBPM4 Building from Source
</h3>
<span style="margin-bottom: 10px;">
modified by <a href="http://community.jboss.org/people/admin">Administrator Administrator</a> in <i>jBPM</i> - <a href="http://community.jboss.org/docs/DOC-12867">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>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.</p><h1>Requirements</h1><ul><li>JDK 5 or higher</li><li>Maven 2.0.9 or higher</li><li>Subversion</li></ul><h1>Other build instructions</h1><ul><li><a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-13343">Jbpm4BuildDesignerFromSources</a></li><li><a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-13342">Jbpm4BuildConsoleFromSources</a></li></ul><h1>Getting the sources</h1><p>Perform anonymous checkout of the sources like this:</p><pre class="jive-pre"><code class="jive-code">svn co http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk jbpm4</code></pre><p>jBPM developers should check out the sources using the following url</p><pre class="jive-pre"><code class="jive-code">svn co https://svn.jboss.org/repos/jbpm/jbpm4/trunk jbpm4</code></pre><h1>Building the default modules</h1><p>To build the default modules run:</p><pre class="jive-pre"><code class="jive-code">[jbpm4]$ mvn clean install
</code></pre><p>Before you commit, first do an update and then this command should run OK with your updates.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>A successfull build/test run ends like this:</p><pre class="jive-pre"><code class="jive-code">[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] ------------------------------------------------------------------------</code></pre><h1>Building the distribution</h1><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>Download the oracle ojdbc14.jar driver here: </span><a class="jive-link-external-small" href="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html" target="_blank">http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Then install the oracle driver into your local repository like this</p><pre class="jive-pre"><code class="jive-code">mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.1.0.5 -Dpackaging=jar -Dfile=path/to/file
</code></pre><p>To build the distribution,</p><pre class="jive-pre"><code class="jive-code">[jbpm4]$ mvn -Pdistro clean install
</code></pre><p>In case you are working outside the Red Hat VPN and downloaded a different version of the Oracle driver, build the distribution as follows.</p><pre class="jive-pre"><code class="jive-code">[jbpm4]$ mvn -Pdistro -Doracle.version=10.1.0.5 clean install
</code></pre><p>After that finishes successfully, you'll find the distribution package in modules/distro/target/jbpm-{version}.zip</p><p>On windows you can add the schemadocs profile with <strong style="font-family: courier new,courier;">-Pschemadocs</strong>. In other operating systems, the schema docs generation fails.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The distribution package is also published in the repository.  (note that it's called jbpm-distro-{version}.zip in the repo)</p><h1>Build scripts</h1><h4>Developer configuration</h4><p>In the following build files, configurable properties can be customized in file <span style="font-family: courier new,courier;"><strong>${user.home}/.jbpm4/build.properties</strong></span></p><p><br/>As a developer, at least you need to specify <strong style="font-family: courier new,courier;">jbpm.parent.dir</strong>  Typically you also want to specify the <strong style="font-family: courier new,courier;">jboss.distro.dir</strong> and the <strong style="font-family: courier new,courier;">eclipse.distro.dir</strong></p><pre class="jive-pre"><code class="jive-code">jbpm.parent.dir=${user.home}/jbpm
jboss.distro.dir=${user.home}/downloads/jboss
eclipse.distro.dir=${user.home}/downloads/eclipse
</code></pre><p>JDBC properties can also be specified in files <span style="font-family: courier new,courier;"><strong>${user.home}/.jbpm4/jdbc/${database}.properties</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Or properties can also be provided on the command line like:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">ant -Djbpm.parent.dir=/usr/jbpmbuild reinstall.jbpm</code></pre><h4>Default values</h4><p>Here are the configurable properties and their default values as used throughout the scripts.</p><pre class="jive-pre"><code class="jive-code"><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}" /></code></pre><h4>qa/build.xml</h4><p>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.</p><pre class="jive-pre"><code class="jive-code">[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
</code></pre><h4>distro/src/main/files/install/build.xml</h4><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">[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
</code></pre><h4>distro/src/main/files/examples/build.xml</h4><p>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.</p><pre class="jive-pre"><code class="jive-code">[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
</code></pre><h3>Testing against a particular database</h3><pre class="jive-pre"><code class="jive-code">[jbpm4]$ mvn -Ddatabase=mysql test</code></pre><h3>Running the test suites on another JDK</h3><p>To run the test suite on another JDK, make sure it is the default java in the path.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>On windows, you can do this easily by a command like this:</p><p><strong style="font-family: courier new,courier;">set PATH=C:\Software\jdk1.6.0_07\bin;%PATH%</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>To see what the current configured JDK is, you can check the version like this</p><p><strong style="font-family: courier new,courier;">java -version<br/></strong></p><h3>Running the enterprise test suite</h3><pre class="jive-pre"><code class="jive-code">[jbpm4]$ mvn -Djboss.bind.address=localhost test</code></pre><h3>Useful maven command line options</h3><p><strong>-DskipTests </strong>will skip execution of the test suite.</p><p><strong>-o </strong>will run the build offline.  Maven will not check the snapshot repositories for updates.  Saves time.</p><p><strong>-U</strong> will force updates of libraries</p><h3>Setting up your eclipse</h3><p>You'll need</p><ul><li>Eclipse 3.4, <a class="jive-link-external-small" href="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)</a> </li><li><span>SVN plugin </span><a class="jive-link-external-small" href="http://subclipse.tigris.org/update_1.4.x" target="_blank">http://subclipse.tigris.org/update_1.4.x</a></li><li><span>MVN plugin </span><a class="jive-link-external-small" href="http://m2eclipse.sonatype.org/update/" target="_blank">http://m2eclipse.sonatype.org/update/</a></li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>After you checked out the jbpm4/trunk, you do:</p><ul><li><strong>File</strong> --> <strong>Import...</strong></li><li><strong>General </strong>--> <strong>Existing projects into Workspace</strong></li><li>Select jbpm4/trunk/modules as the root directory</li><li>All the modules with an eclipse project should now appear.  By default, all the checkboxes are checked</li><li>Click '<strong>Finish</strong>'</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Eclipse will point to the libraries of your local mvn repository.  To get the libraries there, activate '<strong>Project</strong>' --> '<strong>Update All Maven Dependencies</strong>'</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Go to <strong>Window</strong> --> <strong>Preferences</strong> --> <strong>Java </strong>--> <strong>Code Style</strong> --> <strong>Formatter</strong> and import jbpm4/trunk/eclipse/jbpm.profile.xml</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-12867">going to Community</a></p>
        <p style="margin: 0;">Create a new document in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>