Drools 6.1.0.Final Runtime jars

3k Views Asked by At

I am using the Drools 6.1.0.Final documentation to set up my Eclipse environment. I am referring this documentation:

Section "1.3.1.4.4. Drools Runtimes" in "http://docs.jboss.org/drools/release/6.1.0.Final/drools-docs/html_single/"

Out of the many binaries in my drools installation (unzipped the "drools-distribution-6.1.0.Final.zip")

D:\Drools-6.1.0.Final\binaries

Which jars constitute the Drools runtime jar file?

I could just point my eclipse to the drools binaries folder, but I wanted to understand the minimal set of runtime jar files needed by Eclipse.

Section Section "1.3.1.1. Dependencies and JARs" does talk about the dependency jars such as :

knowledge-api.jar
knowledge-internal-api.jar
drools-core.jar
drools-compiler.jar
drools-jsr94.jar
drools-decisiontables.jar

I was able to locate these 4:

drools-core.jar
drools-compiler.jar
drools-jsr94.jar
drools-decisiontables.jar

However these 2 :

knowledge-api.jar
knowledge-internal-api.jar

Is this substitution correct in Drools 6.1.0.Final release

knowledge-api.jar --> kie-api-6.1.0.Final.jar
knowledge-internal-api.jar --> kie-internal-6.1.0.Final.jar

What other jars I will need out of the Drools distribution's binaries folder to create a complete Drools Runtime?

2

There are 2 best solutions below

0
laune On BEST ANSWER

There is no simple answer to your question as it depends on the Drools features actually used by your application. If it uses templates, you'll need drools-templates-.jar. If you load a precompiled knowledge base, you may not need drools-compiler-.jar and the antlr jar.

You shouldn't be needing the drools-jsr94.jar unless you're using this weak (but generic) API.

It also varies with Drools version. 6 has renamed some, and some reordering has taken place in some 5.x version (I think).

What I do is to run my Java application, starting it from the command line using a shell script where I define the class path, e.g. (note that this is truncated - it's a single string, on one line):

export CLASSPATH=".:$root/drools-core-${tag}.jar:$root/kie-api-${tag}.jar:...
    :$root/kie-internal-${tag}.jar."

Now if the Java compiler doesn't find a class, I hunt for it in the jars, and add that. Clumsy? Maybe.

0
Imran On

If you are considering to use a maven. Add this in your pom.xml it can manage your dependncies.

pom.xml

 <dependency>
        <groupId>org.kie</groupId>
        <artifactId>kie-ci</artifactId>
        <version>7.15.0.Final</version>
</dependency>