[jboss-jira] [JBoss JIRA] (DROOLS-2753) SNAPSHOT KJars are always reloaded

Nils Meyer (JIRA) issues at jboss.org
Thu Jul 19 03:01:00 EDT 2018


    [ https://issues.jboss.org/browse/DROOLS-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13607887#comment-13607887 ] 

Nils Meyer commented on DROOLS-2753:
------------------------------------

Sorry, somehow I missed to describe the issue from the users point of view and only explained the root cause i suspect. So here's the description from the users point of view

* Calling org.kie.api.KieServices.newKieContainer(ReleaseId) with a snapshot version e.g. 1.0.0-SNAPSHOT for the first time
** KJar is retrieved from Maven Repo
** Logged message e.g. KieModule was added: ZipKieModule[releaseId=org.demo:demo-rules:1.0.0-SNAPSHOT,file=C:\Users\nils\.m2\repository\org\demo\demo-rules\1.0.0-SNAPSHOT\demo-rules-1.0.0-SNAPSHOT.jar]
* No new deployment to the Maven Repo
* Calling org.kie.api.KieServices.newKieContainer(ReleaseId) with a snapshot version e.g. 1.0.0-SNAPSHOT for the second time
** Expected: KieModule added during the first call is re-used
** Actual
*** Unchanged KJar is reloaded
*** Again a message like the following is logged: KieModule was added: ZipKieModule[releaseId=org.demo:demo-rules:1.0.0-SNAPSHOT,file=C:\Users\nils\.m2\repository\org\demo\demo-rules\1.0.0-SNAPSHOT\demo-rules-1.0.0-SNAPSHOT.jar]

The root cause that I suspect can be found in the description of this issue. 

Nevertheless I'll try to provide a test case and potentially a fix suggestion, too.

> SNAPSHOT KJars are always reloaded
> ----------------------------------
>
>                 Key: DROOLS-2753
>                 URL: https://issues.jboss.org/browse/DROOLS-2753
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 7.8.0.Final
>            Reporter: Nils Meyer
>            Assignee: Mario Fusco
>
> The fix provided in DROOLS-2591 filled the snapshotVersion of the ReleaseId Object in org.drools.compiler.kproject.ReleaseIdImpl.adapt(AFReleaseId) using org.appformer.maven.support.AFReleaseId.getVersion(). This seems to be not correct, as the snapshotVersion is filled with a version of the pattern 1.0.0-SNAPSHOT by this means.
> Later the destinction wether to reload a SNAPSHOT version or not is made by comparing this version to a version of the pattern 1.0.0-20180718.102926-4 retrieved from org.eclipse.aether.artifact.Artifact.getVersion()
> The corresponding tests did not reveal this issue, as they do not test that a non-newer version is not loaded.
> I'll try to provide an updated test and potentially a solution idea, too. 



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list