As a developer I want to create a Maven project and build an executable standalone JAR application. (No Spring Boot)
During development and build processes I want to add a Drools Kie artifact as dependency
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>mydrools</artifactId>
<version>[1.0.0,)</version>
</dependency>
build my application as executable Jar and run it. My application has the code to call the Drools engine:
KieSession kSession = kContainer.newKieSession();
kSession.insert(myBean);
kSession.fireAllRules();
Above all, whilst I deploy my application on production:
- I do not want to install Maven on my production server
- I do not want my application to scan a local nor remote Maven repository
- I want my application automatically scans periodically for a new version of my Drools Kie artifact without any reference to a Maven repository, just looking at the filesystem
I have tried with
String fileName = System.getenv("HOME") + "/libs/mydrools-1.0.0.jar";
File file = new File(fileName);
KieRepository kieRepository = ks.getRepository();
KieContainer kContainer = ks.newKieContainer(ks.newReleaseId("com.mycompany", "mydrools", "1.0.0"));
kieRepository.addKieModule(ks.getResources().newFileSystemResource(file));
KieScanner kScanner = ks.newKieScanner( kContainer );
kScanner.start( 10000L );
Loading the JAR works fine, but it seems that I am also forced to configure at least a minimal Maven repository (~/.m2 folder and a settings.xml). I get a heap of errors by the org.apache.maven plugin and related classes.
Of course I do not want my production environment to rely nor depend on any Maven configuration. I just want to run a JAR with another JAR (e.g. libs/mydrools-1.0.0.jar) as dependency and possibly dynamically reload that dependency whilst I update the libs/mydrools-1.0.0.jar.
Basically I need to set the internal Drools Kie Maven plugin completely disabled (offline).
How is it possible to do this with Drools 6.2.0.Final?
Update
This issue is strictly related with
Using Drools 6 Maven architecture completely offline
http://lists.jboss.org/pipermail/rules-users/2014-June/036245.html