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

KieServices.Factory.get().getKieClasspathContainer() doesn't discover KieModules in a non-Maven project

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.1.0.Final
    • 6.1.0.CR1
    • None

    Description

      If you try to use a ClassPath Container KieContainerImpl uses a ClasspathKieProject that scans the classpath for pom.xml or pom.properties files. If the consuming project is not a Maven project (and hence lacks either a pom.xml or pom.properties file) no KBases/KSessions defined in the consuming project's kmodule.xml and /resources folder are discovered.

      This also manifests as a problem when running Maven WebApp projects in IDEA (other IDE's and project types may be similarly affected). IDEA copies the JARs sources and resources to the target folder at runtime; which excludes the module's pom.xml and pom.properties files.

      Consequentially ClasspathKieProject fails to determine a ReleaseId for any KieModules defined in the module and hence fails to discover any KBases/KSessions too.

      See https://github.com/ederign/uf-social-activities/blob/master/uberfire-social-activities/uberfire-social-activities-backend/src/main/java/org/uberfire/social/activities/drools/SocialTimelineRulesQuery.java#L43 where we try to use a named KSession.

      This is defined in https://github.com/ederign/uf-social-activities/blob/master/uberfire-social-activities/uberfire-social-activities-backend/src/main/resources/META-INF/kmodule.xml

      Rules being in https://github.com/ederign/uf-social-activities/tree/master/uberfire-social-activities/uberfire-social-activities-backend/src/main/resources/org/uberfire/social/activities/drools-rules

      Workaround is to include a dummy pom.properties; as we did here https://github.com/ederign/uf-social-activities/blob/master/uberfire-social-activities/uberfire-social-activities-backend/src/main/resources/META-INF/maven/pom.properties

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            manstis@redhat.com Michael Anstis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: