Home » Java » java – KieScanner cannot fetch LATEST Jars from custom Maven repository – Maven – 3.6.3-Exceptionshub

java – KieScanner cannot fetch LATEST Jars from custom Maven repository – Maven – 3.6.3-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am using a drool version 7.x. I am able to get KieScanner to work on my local maven repository using “LATEST”. But everytime I update the rules on workbench, I have to manually run mvn install in order to update my local repository so that
KieScanner can pickup the changes. Is that how it is? Or is it possible to force a download every time the scanner runs?

I need to fetch the latest jars from my custom repo.

My configuration

 KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId = ks.newReleaseId( "com.test", "poc", "LATEST" );

    KieContainer kContainer = ks.newKieContainer(releaseId);
    KieScanner kieScanner = ks.newKieScanner(kContainer);

    kieScanner.start( 10000L );

    Scanner scanner = new Scanner(System.in);

    while (true) {
        kieScanner.scanNow();
        String line = scanner.nextLine();
        runRule(kContainer);
    }
}

I have configured my custom repo in maven settings file.

     <profile>
        <id>development</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>customRepo</id>
                <url>https://customRepo/v2</url>
                <releases>
                    <enabled>false</enabled>
<updatePolicy>always</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>
 <activeProfiles>
   <activeProfile>development</activeProfile>
 </activeProfiles>

Exception : Unable to resolve artifact: com.test :LATEST

I have tried all the links below. But no luck

KieScanner cannot fetch LATEST version automatically!

KieScanner with remote maven repo

Loading Drools/KIE Workbench artifacts directly from the repository

How do I tell Maven to use the latest version of a dependency?

how do I tell maven 3.6.3 to get latest version of artifact from custom repository

https://access.redhat.com/solutions/1592893

KieScanner not updating KieSessions at runtime

KieScanner not working in Drools 6.1

KieScanner not updating jar from remote nexus repository (Drools 6.5.0.Final)

Any one please advise to resolve the issue?

How to&Answers: