13.4. Maven
Maven integration is not supported by Red Hat in JBoss Enterprise BRMS 5.3.1 and the following is provided as an example only.
Procedure 13.1. Importing the Drools and jBPM Jar Files to the Local Maven Repository
- Download the deployable package zip file from the Red Hat Customer Support Portal at https://access.redhat.com. Select
, then select the version and JBoss BRMS 5.3.1. - Extract the zip archive.
- Extract the
jboss-brms-engine.zip
andjboss-jbpm-engine.zip
archives. - Run the following maven commands to import the Drools and jBPM jar files to the local maven repository:
mvn install:install-file -Dfile=knowledge-api-5.3.1.BRMS.jar -DgroupId=org.drools -DartifactId=knowledge-api -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=drools-core-5.3.1.BRMS.jar -DgroupId=org.drools -DartifactId=drools-core -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=drools-compiler-5.3.1.BRMS.jar -DgroupId=org.drools -DartifactId=drools-compiler -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=drools-decisiontables-5.3.1.BRMS.jar -DgroupId=org.drools -DartifactId=drools-decisiontables -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=drools-templates-5.3.1.BRMS.jar -DgroupId=org.drools -DartifactId=drools-templates -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=drools-persistence-jpa-5.3.1.BRMS.jar -DgroupId=org.drools -DartifactId=drools-persistence-jpa -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=jbpm-flow-5.3.1.BRMS.jar -DgroupId=org.jbpm -DartifactId=jbpm-flow -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=jbpm-flow-builder-5.3.1.BRMS.jar -DgroupId=org.jbpm -DartifactId=jbpm-flow-builder -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=jbpm-bam-5.3.1.BRMS.jar -DgroupId=org.jbpm -DartifactId=jbpm-bam -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=jbpm-bpmn2-5.3.1.BRMS.jar -DgroupId=org.jbpm -DartifactId=jbpm-bpmn2 -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=jbpm-human-task-5.3.1.BRMS.jar -DgroupId=org.jbpm -DartifactId=jbpm-human-task -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=jbpm-persistence-jpa-5.3.1.BRMS.jar -DgroupId=org.jbpm -DartifactId=jbpm-persistence-jpa -Dversion=5.3.1.BRMS -Dpackaging=jar mvn install:install-file -Dfile=jbpm-workitems-5.3.1.BRMS.jar -DgroupId=org.jbpm -DartifactId=jbpm-workitems -Dversion=5.3.1.BRMS -Dpackaging=jar
Note
The list of imported jar files above is not complete. Make sure you import alldrools
,knowledge
, andjbpm
jar files.
A Maven pom.xml file defines project dependencies, which are automatically retrieved when building the project with Maven. The following pom.xml file is an example that shows how to declare dependencies for different use cases:
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.jbpm</groupId> <artifactId>jbpm-maven-example</artifactId> <name>jBPM Maven Project</name> <version>1.0-SNAPSHOT</version> <brms-version>5.3.1.BRMS<brms-version> ... <dependencies> <!-- core dependencies --> <dependency> <groupId>org.drools</groupId> <artifactId>knowledge-api</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.drools</groupId> <artifactId>drools-core</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.mvel</groupId> <artifactId>mvel2</artifactId> <version>2.1.Beta6</version> </dependency> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.3.1</version> </dependency> <!-- required to compile DRL --> <dependency> <groupId>org.drools</groupId> <artifactId>drools-compiler</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.eclipse.jdt.core.compiler</groupId> <artifactId>ecj</artifactId> <version>3.5.1</version> </dependency> <dependency> <groupId>org.antlr</groupId> <artifactId>antlr-runtime</artifactId> <version>3.3</version> <exclusions> <exclusion> <groupId>org.antlr</groupId> <artifactId>stringtemplate</artifactId> </exclusion> </exclusions> </dependency> <!-- required to compile decision tables --> <dependency> <groupId>org.drools</groupId> <artifactId>drools-decisiontables</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.drools</groupId> <artifactId>drools-templates</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>net.sourceforge.jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.6.10</version> </dependency> <!-- required for jBPM5 processes --> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-flow</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-flow-builder</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-bam</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-bpmn2</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-human-task</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-persistence-jpa</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-workitems</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>org.drools</groupId> <artifactId>drools-persistence-jpa</artifactId> <version>${brms-version}</version> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>2.4.1</version> </dependency> </dependencies> </project>
To use this as the basis for a project in Eclipse, either use M2Eclipse or use "mvn eclipse:eclipse" to generate eclipse .project and .classpath files based on this pom.