Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1762

kie-maven-plugin: Make use of project dependencies to avoid their declaration inside kie-maven-plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • build
    • None
    • NEW
    • NEW

      Suppose I use a guided decision table, which contains a custom Planner RHS IAction (e.g. ActionSimpleConstraintMatch). The Planner IAction is located in the following module:

      <dependency>
            <groupId>org.optaplanner</groupId>
            <artifactId>optaplanner-workbench-models-datamodel-api</artifactId>
      </dependency>
      

      My project depends on the optaplanner-workbench-models-datamodel-api module, so does kie-maven-plugin, see the link. If I remove the dependency from kie-maven-plugin, the build of my project fails with the following error:

      [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] -------------------------------
      

      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.

            mdessi-1 Massimiliano Dessi
            mcimbora_jira Matej Čimbora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: