I have the code below to load my KieContainer
String url = "http://X.X.X.X:8081/repository/maven-releases/com/some/company/rules-config/0.0.2/rules-config-0.0.2.jar";
KieServices kieServices = KieServices.Factory.get();
kieServices.getResources().newUrlResource(url);
ReleaseId releaseId = kieServices.newReleaseId(GROUP_ID, "rules-config", "0.0.2-SNAPSHOT");
KieContainer kContainer = kieServices.newKieContainer(releaseId);
KieScanner kScanner = kieServices.newKieScanner(kContainer);
kScanner.start(2000L);
Currently the application loads the jar file at the system startup. But when i push a new jar of the same version the scanner is not loading the jar based on timestamp.
The same code as below
KieServices kieServices = KieServices.Factory.get();
ReleaseId releaseId = kieServices.newReleaseId(GROUP_ID, "rules-config", "0.0.2-SNAPSHOT");
KieContainer kContainer = kieServices.newKieContainer(releaseId);
KieScanner kScanner = kieServices.newKieScanner(kContainer);
kScanner.start(2000L);
update: settings.xml (in the local machines m2 directory)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<!--<localRepository>path to some directory.eg d:\repository</localRepository> -->
<mirrors>
<mirror>
<id>nexus</id>
<name>somecompany</name>
<url>http://X.X.X.X:8081/repository/maven-public</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<servers>
<server>
<id>nexus</id>
<username>XXXXXX</username>
<password>XXXXXX</password>
</server>
</servers>
<profiles>
<profile>
<id>development</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>http://X.X.X.X:8081/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:1</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
Works fine when i do a local build and install. The rules are getting refreshed based on the timestamp though the jars are of same version.
Is there anything missing in my understanding ? How exactly does the KieScanner work ?
Does the KieScanner work only when the jar is installed in to the local maven repository on the same system as the server ?