-
Bug
-
Resolution: Done
-
Major
-
6.1.0.CR1
-
None
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
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