[jboss-jira] [JBoss JIRA] (DROOLS-2839) Document how to run Drools with a flat classpath by merging kie.conf files

Tibor Zimányi (Jira) issues at jboss.org
Thu Oct 11 06:50:00 EDT 2018


    [ https://issues.jboss.org/browse/DROOLS-2839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646473#comment-13646473 ] 

Tibor Zimányi commented on DROOLS-2839:
---------------------------------------

Poker: 2

> Document how to run Drools with a flat classpath by merging kie.conf files
> --------------------------------------------------------------------------
>
>                 Key: DROOLS-2839
>                 URL: https://issues.jboss.org/browse/DROOLS-2839
>             Project: Drools
>          Issue Type: Task
>          Components: docs
>    Affects Versions: 7.9.0.Final
>            Reporter: Duncan Doyle
>            Assignee: Mario Fusco
>            Priority: Major
>
> When running Drools in a Fat JAR, for example created by the Maven Shade Plugin, the various "kie.conf" files of the Drools JARs (e.g. drools-core, drools-compiler) need to be merged, otherwise , the Fat JAR will contain only 1 kie.conf from a single dependency, resulting into errors.
> This is for example required when running Drools in a Vert.x application. 
> You can merge resources in the Maven Shade Plugin using transformers, like this:
> {code}
> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
>     <resource>META-INF/kie.conf</resource>
> </transformer>
> {code}
> For example, in my Vert.x app this is the full config of the Maven Shade Plugin:
> {code}
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-shade-plugin</artifactId>
>     <version>3.1.0</version>
>     <executions>
>         <execution>
>             <phase>package</phase>
>             <goals>
>                 <goal>shade</goal>
>             </goals>
>             <configuration>
>                 <transformers>
>                     <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
>                         <manifestEntries>
>                             <Main-Class>io.vertx.core.Launcher</Main-Class>
>                             <Main-Verticle>${main.verticle}</Main-Verticle>
>                         </manifestEntries>
>                     </transformer>
>                     <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
>                         <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
>                     </transformer>
>                     <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
>                         <resource>META-INF/kie.conf</resource>
>                     </transformer>
>                 </transformers>
>                 <artifactSet>
>                 </artifactSet>
>                 <outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
> {code}



--
This message was sent by Atlassian Jira
(v7.12.1#712002)



More information about the jboss-jira mailing list