[rules-users] How to determine Drools runtime version?

Ansgar Konermann ansgar.konermann at googlemail.com
Sat Dec 29 17:46:08 EST 2012


Hi,

I'd like to determine at runtime which version of Drools is in use/on
the classpath. I cannot use reflection on the Drools classes itself, as
this will not work in the intended runtime environment (Google App Engine).

The following code works in a normal Java VM, but not in GAE:

    Package droolsCorePackage = KnowledgePackageImp.class.getPackage();
    String implementationTitle = droolsCorePackage.getImplementationTitle();
    String implementationVersion =
droolsCorePackage.getImplementationVersion();

In GAE, the getImplementation{Title|Version} methods both return null.

Is there another, maybe more "official" way of determining the Drools
version? I'd like to support Drools 5.x.y starting at x >= 3.

Best regards

Ansgar



More information about the rules-users mailing list