Integrating a Java application using Ivy with JFrog Artifactory and KIE 6.4.0 Final

120 views
Skip to first unread message

MandM Stansell

unread,
Mar 23, 2017, 10:37:56 AM3/23/17
to Drools Usage
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?

MandM Stansell

unread,
Apr 5, 2017, 12:40:53 PM4/5/17
to Drools Usage
@mdproctor, @etirelli - is this question/issue posted in the correct forum?

MandM Stansell

unread,
Apr 19, 2017, 11:06:46 AM4/19/17
to Drools Usage
Maciej Swiderski, can you please assist?
@mswiderski
@swiderskimaciej

Michael Anstis

unread,
Apr 19, 2017, 11:12:34 AM4/19/17
to Drools Usage
KieServices will use Maven for dependency resolution; however it appears possible to configure a local Maven installation to resolve from JFrog: https://www.jfrog.com/confluence/display/RTF/Maven+Repository

I say "appears" as I have no knowledge of JFrog nor its integration with Maven (other than my quick Google...)

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/d1cc2083-9b46-4067-bfc4-7214aa41be15%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages