I'm developing a Maven project using java and Drools 6.2.0, and I'm trying to "bind" a certain DRL file to a KieBase through the kmodule.xml file, but I keep getting the error
WARN org.drools.compiler.kie.builder.impl.AbstractKieModule - No files found for KieBase
when running the project.
I think I've configured everything the right way, as shown in the documentation (Chapter 4.2.2 - Overview - Build, Deploy, Utilize and Run - Building), but can't see where is my mistake.
In this project, I think it's not an option for me to declare/configure Drools by coding, due to the project architecture, that's why I'm using the kmodule.xml approach.
Any suggestion is welcome.
My kmodule.xml (location: src/main/resources/META-INF):
<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="departureKB" packages="com.site.myapp.checks.departure">
<ksession name="departureKS" type="stateless" />
</kbase>
</kmodule>
My DRL file (dummy) (location: src/main/resources/com/site/myapp/checks/departure):
package com.site.myapp.checks.departure
rule "my rule 1"
when
// some conditions
then
// something to do
end
My class Departure (only the Drools code) (location: src/com/site/myapp/checks):
channelName = "departure";
KieServices ks = KieServices.Factory.get();
KieContainer kc = ks.getKieClasspathContainer();
String kSessionName = channelName+"KS";
kSession = kc.newStatelessKieSession(kSessionName);
My pom.xml (only the Drools dependencies) :
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-bom</artifactId>
<version>6.2.0.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>6.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>6.2.0.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>named-kiesession</artifactId>
<version>6.2.0.Final</version>
</dependency>