سؤال

How to deploy a simple Drools application?

Please note that this is not a web-application. It's just a simple rules engine application that evaluates a set of facts pertaining to a set of POJO variables.

I couldn't find any specific information on the official Drools website or in Google search results/stack overflow.

I'm working my way through the Drools examples (http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_single/#d0e8772) on Eclipse and would like to deploy a simple example on a Linux machine - as a stepping stone to deploying a more complex application.

Shouldn't this be straightforward as in exporting a runnable JAR from Eclipse, copying out this JAR to a Linux machine and then invoking this JAR by way of # java -jar .jar ?

Help appreciated. Thanks.

هل كانت مفيدة؟

المحلول

Encouraged by @Steve's comment I'll post my two cents as an answer.

The deployment should be exactly as easy as you described it in your question. At simplest

  1. Write the code and rules

  2. Package the app to JAR

  3. Run the app( from command line with java -jar option)

Just make sure you have all the libs included in the package and that the rules are in a location where they can be executed by the app (classpath for example).

Thanks to @Steve for pointing to Maven Shade Plugin. It sure seems to be more user-friendly than the awful jar-with-dependencies assembly. Now that Maven as build tool has been suggested, check this question regarding on how to build a Drools app with Maven.

I'm pretty sure Eclipse has some nice feature for exporting as a JAR as well.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top