]
RH Bugzilla Integration commented on DROOLS-531:
------------------------------------------------
Ryan Zhang <rzhang(a)redhat.com> changed the Status of [bug
KieServices.Factory.get().getKieClasspathContainer() doesn't
discover KieModules in a non-Maven project
-------------------------------------------------------------------------------------------------------
Key: DROOLS-531
URL:
https://issues.jboss.org/browse/DROOLS-531
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 6.1.0.CR1
Reporter: Michael Anstis
Assignee: Mario Fusco
Labels: backport-to-6.0.x
Fix For: 6.1.0.Final
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-soci...
where we try to use a named KSession.
This is defined in
https://github.com/ederign/uf-social-activities/blob/master/uberfire-soci...
Rules being in
https://github.com/ederign/uf-social-activities/tree/master/uberfire-soci...
Workaround is to include a dummy pom.properties; as we did here
https://github.com/ederign/uf-social-activities/blob/master/uberfire-soci...