Now that we have the source the next step is to build and install the source. Since version 3.1 Drools uses Maven 2 to build the system. There are two profiles available which enable the associated modules "documentation" and "Eclipse"; this enables quicker building of the core modules for developers. The Eclipse profile will download Eclipse into the drools-Eclipse folder, which is over 100MB download (It depends on your operating system), however this only needs to be done once; if you wish you can move that Eclipse download into another location and specify it with -DlocalEclipseDrop=/folder/jboss-drools/local-Eclipse-drop-mirror. The following builds all the jars, the documentation and the Eclipse zip with a local folder specified to avoid downloading Eclipse:
mvn -Declipse -Ddocumentation clean install -DlocalEclipseDrop=/folder/jboss-drools/local-Eclipse-drop-mirror
You can produce distribution builds, which puts everything into zips, as follows:
mvn -Declipse -Ddocumentation clean install -DlocalEclipseDrop=/folder/jboss-drools/local-Eclipse-drop-mirror mvn -Ddocumentation -Declipse -Dmaven.test.skip package javadoc:javadoc assembly:assembly -DlocalEclipseDrop=/folder/jboss-drools/local-Eclipse-drop-mirror
Note that install must be done first as javadoc:javadoc won't work unless the jars are in the local maven repo, but the tests can be skipped on the second run. assembly:assembly fails unless you increase the available memory to Maven, on windows the following command worked well: set MAVEN_OPTS=-Xmx512m
Type mvn clean to clear old artifacts, and then test and built the source, and report on any errors.
The resulting jars are put in the /target directory from the top level of the project.
As maven builds each module it will install the resulting jars in
the local Maven 2 repository automatically. Where it can be easily used
from other project pom.xml
or copied else where.
The building of the manual is now integrated into the maven build process, and is built by either using the profile (-Ddocumentation) switch or cding into the main directory.
Drools uses Docbook for this manual. Maven is used to build documents and this build produces three different formats, all sharing the same images directory.
The manual can be generated from the project pom.xml by
calling 'mvn package'
in the drools-docs directory or adding the -Ddocumentation switch when you build the sources.
Documentation is generated into each drools-docs subdirectory's 'target/'
directory. Running 'mvn -Ddocumentation package assembly:assembly'
in the Drools project root generates and copies the documentation into a zip file. This zip file is located in the root folders 'target/'
directory.
[trikkola@trikkola trunk]$ mvn -Ddocumentation clean package assembly:assembly [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Drools [INFO] Drools :: API [INFO] Drools :: Core [INFO] Drools :: Compiler [INFO] Drools :: Templates [INFO] Drools :: Decision Tables [INFO] Drools :: JSR-94 API Module [INFO] Drools :: Pipeline :: Transformer :: Smooks [INFO] Drools :: Pipeline :: Transformer :: JAXB [INFO] Drools :: Pipeline :: Transformer :: XStream [INFO] Drools :: Pipeline :: Transformer :: JXLS [INFO] Drools :: Pipeline :: Messenger :: JMS [INFO] Drools :: Pipeline [INFO] Drools :: Process :: WorkItems [INFO] Drools :: Process :: Task [INFO] Drools :: Process :: BAM [INFO] Drools :: Process [INFO] Drools :: Persistence :: JPA [INFO] Drools :: Server [INFO] Drools :: Verifier [INFO] Drools :: Ant Task [INFO] Drools :: Repository [INFO] Drools :: Guvnor [INFO] Drools :: Microcontainer [INFO] Drools :: Clips [INFO] Drools :: Solver parent [INFO] Drools :: Solver core [INFO] Drools :: Solver examples [INFO] Searching repository for plugin with prefix: 'assembly'. WAGON_VERSION: 1.0-beta-2 [INFO] ------------------------------------------------------------------------ [INFO] Building Drools [INFO] task-segment: [clean, package] [INFO] ------------------------------------------------------------------------ [INFO] [clean:clean] [INFO] [site:attach-descriptor] [INFO] Preparing source:jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [INFO] No goals needed for project - skipping [INFO] [source:jar {execution: default}] [INFO] Preparing source:test-jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [WARNING] Removing: test-jar from forked lifecycle, to prevent recursive invocation. [INFO] No goals needed for project - skipping [INFO] [source:test-jar {execution: default}] [INFO] ------------------------------------------------------------------------ [INFO] Building Drools :: API [INFO] task-segment: [clean, package] [INFO] ------------------------------------------------------------------------ [INFO] [clean:clean] [INFO] Deleting directory /home/trikkola/jboss-drools/trunk/drools-api/target ...snip ... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] ------------------------------------------------------------------------ [INFO] Drools ................................................ SUCCESS [59.889s] [INFO] Drools :: API ......................................... SUCCESS [4.832s] [INFO] Drools :: Core ........................................ SUCCESS [11.027s] [INFO] Drools :: Compiler .................................... SUCCESS [10.400s] [INFO] Drools :: Templates ................................... SUCCESS [1.018s] [INFO] Drools :: Decision Tables ............................. SUCCESS [1.179s] [INFO] Drools :: JSR-94 API Module ........................... SUCCESS [1.001s] [INFO] Drools :: Pipeline :: Transformer :: Smooks ........... SUCCESS [0.651s] [INFO] Drools :: Pipeline :: Transformer :: JAXB ............. SUCCESS [0.711s] [INFO] Drools :: Pipeline :: Transformer :: XStream .......... SUCCESS [0.465s] [INFO] Drools :: Pipeline :: Transformer :: JXLS ............. SUCCESS [0.481s] [INFO] Drools :: Pipeline :: Messenger :: JMS ................ SUCCESS [0.879s] [INFO] Drools :: Pipeline .................................... SUCCESS [0.006s] [INFO] Drools :: Process :: WorkItems ........................ SUCCESS [1.526s] [INFO] Drools :: Process :: Task ............................. SUCCESS [3.104s] [INFO] Drools :: Process :: BAM .............................. SUCCESS [0.580s] [INFO] Drools :: Process ..................................... SUCCESS [0.005s] [INFO] Drools :: Persistence :: JPA .......................... SUCCESS [0.958s] [INFO] Drools :: Server ...................................... SUCCESS [2.216s] [INFO] Drools :: Verifier .................................... SUCCESS [1.836s] [INFO] Drools :: Ant Task .................................... SUCCESS [0.722s] [INFO] Drools :: Repository .................................. SUCCESS [3.925s] [INFO] Drools :: Guvnor ...................................... SUCCESS [19.850s] [INFO] Drools :: Microcontainer .............................. SUCCESS [0.676s] [INFO] Drools :: Clips ....................................... SUCCESS [1.464s] [INFO] Drools :: Solver parent ............................... SUCCESS [0.527s] [INFO] Drools :: Solver core ................................. SUCCESS [2.209s] [INFO] Drools :: Solver examples ............................. SUCCESS [4.689s] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2 minutes 24 seconds [INFO] Finished at: Tue Apr 07 15:11:14 EEST 2009 [INFO] Final Memory: 48M/178M [INFO] ------------------------------------------------------------------------>
The generated manual can be found in the
target\drools-docs$VERSION.jar'
file, a compressed archive with all formats.