Reputation: 3400
I am doing a sample hello world maven project using drools version 6.0.0.Final. Below is the build of my pom file, i have specified the kie-maven-plugin but i can notice that this plugin couldnt get executed. Is there anything i am missing here.
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>${kieVersion}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Upvotes: 0
Views: 7870
Reputation: 11
This is quite an old topic but I just had the same issue, and found nothing to help me. In my case, it was not a configuration error, but a rule synthax error.
I had something like :
when $a : A(status == Status.OK, $val = val)
Instead of :
when $a : A(status == OK, $val : val)
Changing the " = " to " : " fixed it. I don't know why it refered to KIE though.
Upvotes: 0
Reputation: 725
Got the same problem with 6.3.0. Here is the code I'm using to activate the drools compilation :
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>6.3.0.Final-redhat-9</version>
<extensions>true</extensions>
<executions>
<execution>
<id>brms-rules-compilation</id>
<phase>generate-resources</phase>
<goals>
<goal>build</goal>
</goals>
<inherited>false</inherited>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
I had to specifically tell Maven to execute the build
goal during generate-resources
phase to get a plugin console output :
[INFO] --- kie-maven-plugin:6.3.0.Final-redhat-9:build (brms-rules-compilation) @ myProject ---
[main] INFO org.drools.compiler.kie.builder.impl.KieRepositoryImpl - Adding KieModule from resource [.....]
Upvotes: 1
Reputation: 6523
I know it is an old question, but did you specify the correct packaging?
<project xmlns="http://maven.apache.org/POM/4.0.0" >
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo</groupId>
<artifactId>fighting</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>kjar</packaging>
Together with using the kie-maven plugin?
Upvotes: 1
Reputation: 51
Your config looks ok, but you might hit some missing plugin dependencies.
Using the latest version of the kie-maven-plugin (6.0.3-redhat-4) it does pre-compile the drl/xls etc.. rules inside the module into the jar. You can find the precompiled content in the jar if you crack it open - yourmodule-version.jar/META-INF/defaultKieBase/kbase.cache.
You should also see, as maven is building, the kie-maven-plugins "build" output on the console - just to check it is executing.
Upvotes: 1