I am integrating an application running in a WAR on Tomcat to Drools rules authored in KIE 6.4.0 Final. I am trying to follow "4.2.6.5. KieContainer from KieRepository" from the KIE/Drools documentation in my Eclipse (neon) IDE. One obvious difference is that I'm integrating from an Ivy project, rather than a Maven project, so there is an Ivy.xml file rather than a pom.xml file.
The ivy.xml is below. It lists kie-ci as a dependency as well as listing a KJAR file that is resolved from my JFrog Artifactory repository. The KJAR file is successfully resolved into my Directory Libraries folder under /nb-service/build/lib.
<ivy-module version="2.0">
<info organisation="com.foo.bar" module="nb-service"/>
<configurations>
<conf name="compile" description="Required to compile application"/>
<conf name="sources" description="Source code"/>
<conf name="javadoc" description="Javadocs"/>
</configurations>
<dependencies>
<dependency org="org.kie" name="kie-ci" rev="6.4.0.Final" conf="compile->default;sources;javadoc" >
<exclude name="junit"/>
</dependency>
<dependency org="NextGen_NB" name="PreAppSubmit" rev="1.0.2"/>
</dependencies>
</ivy-module>
The pom.xml inside the JKAR itself points back to the KIE server (AWS) on which I authored the rules. The KJAR is also reachable there from a browser on my machine at https://<server>/kie-wb/maven2/NextGen_NB/PreAppSubmit/1.0.2/PreAppSubmit-1.0.2.jar. I exported the KJAR from KIE and imported it into JFrog Artifactory so my Ivy project could resolve the dependency.
Excerpt of the pom.xml embedded in the KJAR:
<repositories>
<repository>
<id>guvnor-m2-repo</id>
<name>Guvnor M2 Repo</name>
<url>https://<server>/kie-wb/maven2/</url>
</repository>
</repositories>
The code I am running is:
KieServices ks = KieServices.Factory.get();
ReleaseId rID = ks.newReleaseId("NextGen_NB", "PreAppSubmit", "1.0.2");
KieContainer kContainer = ks.newKieContainer(rID);
The error I am receiving is:
WARN : org.kie.scanner.MavenRepository.resolveArtifact - Unable to resolve artifact: NextGen_NB:PreAppSubmit:1.0.2
WARN : org.kie.scanner.MavenRepository.resolveArtifact - Unable to resolve artifact: NextGen_NB:PreAppSubmit:pom:1.0.2
ERROR: com.csc.fsg.life.common.rules.DroolsRuleServiceImpl.executeKieLocalApiBatchCommand - Error calling KIE locally
java.lang.RuntimeException: Cannot find KieModule: NextGen_NB:PreAppSubmit:1.0.2
at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:117)
at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:111)
at com.csc.fsg.life.common.rules.DroolsRuleServiceImpl.executeKieLocalApiBatchCommand(DroolsRuleServiceImpl.java:135)
So, long explanation, but the first, most basic question that I have is whether the kie-ci library is capable of working in an Ivy project that is resolving binary files from JFrog Artifactory?