]
Massimiliano Dessi closed DROOLS-1762.
--------------------------------------
Resolution: Won't Fix
kie-maven-plugin: Make use of project dependencies to avoid their
declaration inside kie-maven-plugin
-----------------------------------------------------------------------------------------------------
Key: DROOLS-1762
URL:
https://issues.redhat.com/browse/DROOLS-1762
Project: Drools
Issue Type: Bug
Components: build
Reporter: Matej Čimbora
Assignee: Massimiliano Dessi
Priority: Major
Attachments: dinnerparty.zip
Suppose I use a guided decision table, which contains a custom Planner RHS IAction (e.g.
[
ActionSimpleConstraintMatch|https://github.com/kiegroup/optaplanner/blob/...]).
The Planner IAction is located in the following module:
{code:xml}
<dependency>
<groupId>org.optaplanner</groupId>
<artifactId>optaplanner-workbench-models-datamodel-api</artifactId>
</dependency>
{code}
My project depends on the optaplanner-workbench-models-datamodel-api module, so does
kie-maven-plugin, see the
[
link|https://github.com/kiegroup/droolsjbpm-integration/blob/master/kie-m...].
If I remove the dependency from kie-maven-plugin, the build of my project fails with the
following error:
{code:xml}
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:8.0.0-SNAPSHOT:build
(default-build) on project dinnerparty: Execution default-build of goal
org.kie:kie-maven-plugin:8.0.0-SNAPSHOT:build failed:
[ERROR] ---- Debugging information ----
[ERROR] cause-exception :
com.thoughtworks.xstream.mapper.CannotResolveClassException
[ERROR] cause-message :
org.optaplanner.workbench.models.datamodel.rule.ActionSimpleConstraintMatch
[ERROR] class : java.util.ArrayList
[ERROR] required-type : java.util.ArrayList
[ERROR] converter-type :
com.thoughtworks.xstream.converters.collections.CollectionConverter
[ERROR] path :
/decision-table52/actionCols/org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn/definition/org.optaplanner.workbench.models.datamodel.rule.ActionSimpleConstraintMatch
[ERROR] class[1] :
org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn
[ERROR] converter-type[1] :
com.thoughtworks.xstream.converters.reflection.ReflectionConverter
[ERROR] class[2] :
org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52
[ERROR] version : 1.4.10
[ERROR] -------------------------------
{code}
I tried to load the
org.optaplanner.workbench.models.datamodel.rule.ActionSimpleConstraintMatch class inside
org.drools.workbench.models.guided.dtable.backend.GuidedDTXMLPersistence using
getClass().getClassLoader().loadClass("org.optaplanner.workbench.models.datamodel.rule.ActionSimpleConstraintMatch"),
leading to ClassNotFoundException.
Expected behavior:
Be able to use external classes in a kie project without the need to declare them
directly in kie-maven-plugin. It should be enough to declare those dependencies in the
project that I'm building.
Attaching a reproducer (dinnerparty.zip). Should build fine out of the box. Now try to
make a local build of kie-maven-plugin with
org.optaplanner:optaplanner-workbench-models-datamodel-api dependency removed. Build
dinnerparty project again, the issue described above should pop up.