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

KieScanner tries to read test dependencies

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.8.0.Final
    • core engine
    • None
    • 2020 Week 10-12 (from Mar 2)
    • Hide

      1) Add drools-decisiontables as dependency with test scope to POM of project containing rules
      2) Compile and deploy the project containing rules
      3) Try to use the deployed project from maven repository (will fail)

      Show
      1) Add drools-decisiontables as dependency with test scope to POM of project containing rules 2) Compile and deploy the project containing rules 3) Try to use the deployed project from maven repository (will fail)
    • NEW
    • NEW

      Method KieRepositoryScannerImpl#indexArtifacts first reads ALL dependencies and then tries to exclude those with scope test/provided/system. This is wrong since the nested dependencies might have different scope. Conseder this case:

      A -> depends on B (with scope test)
      B -> depends on C (with scope compile)

      Asking for allDependencies will yield following descriptors:

      A (compile scope)
      B (test scope)
      C (compile scope)

      B gets discarded, but C remains and scanner will try to resolve it and add to class loader.

      Instead of fitering the results of ArtifactResolver#getAllDependencies() (without parameters) you should use overloaded version of this method that accepts dependency filter.

      I do not create rules via GUI, but have them in separate Maven project. This projects contains tests cases that check if the rules are OK. The tests create the knowlege base from filesystem and require drools-decisiontables in order to execute.

              mfusco@redhat.com Mario Fusco
              ales_d Ales Dolecek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: