Ickster
Ickster

Reputation: 2217

Drools KieScanner -- is it possible to load settings.xml from within the executable?

I'm using KieScanner with Drools 7.x in a Spring Boot project, and dynamic rule loading is working just fine locally.

However, I've run into a problem when preparing to deploy to an environment.

Drools uses an embedded Maven client to check against a remote repository or new versions of rules artifacts. Locations of remote repositories are through the standard Maven settings.xml. The Drools documentation specifies that the location of settings.xml can be:

I looked into the approach they seem to require, but because of infrastructure configuration restrictions in the organization, I'm unable to deploy a static file to the hosts running our executable (and Docker is also not an option).

Is there any way to either bundle the settings.xml in the executable and load it from there, or to provide settings for the remote repository in another fashion?

Upvotes: 0

Views: 608

Answers (1)

Ickster
Ickster

Reputation: 2217

I eventually dug into the source for the KieScanner and found that there's a feature in the library which it uses for resolving the path to settings.xml which is documented in the source project, but not in the Drools documentation. That library takes a String as a path, but if the path does not exist, it attempts to transform it to a URL. I was then able to host the settings.xml remotely and refer to it by URL.

Upvotes: 0

Related Questions