[rules-users] Drool 6.0.0.Final, 2 question re kie-maven-plugin, please?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[rules-users] Drool 6.0.0.Final, 2 question re kie-maven-plugin, please?

tari-manga
Ciao, with premise I'm not a Maven expert...

I'm following now the new recommended version for 6.0 KIE project/module development as documented in [1] by generating a new maven archetype "quickstart" but if compared to the documentation I found, at least in my case, I had at a minimum to apply also the following in the pom.xml:
A. the packaging must be changed to "kjar"
B. if the project and the rules depend on an external library/maven artifact, say for instance the object model or domain model objects the rules will be based on, it is NOT enough to declare them in the pom.xml <dependencies>, but the exact same dependencies MUST ALSO be also declared within the kie-maven-plugin <plugin> <dependencies> as well.

Failing to do so, would imply that, respectively:
A. when you run Maven with the default "mvn package" or "mvn deploy" etc, the kie-maven-plugin would not trigger
B. kie-maven-plugin will fail the build because unable to resolve the "external" classes referenced in the .drl, with a message similar to [ERROR] Message [id=3, level=ERROR, path=package.drl, line=3, column=0 text=Unable to find class 'classname']

Questions are:
1. Is this correct, or I'm just complicating my life without noticing, and it is existing a simpler way, please?
2. Especially point #B, is this really the intended behavior, having to replicate the dependencies in the two parts of the pom.xml ?

Thanks if somebody can feedback on this,
Ciao
MM

I'm making reference to:

For reference, here is an example pom.xml I'm using:

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.acme</groupId>
  <artifactId>my-rules</artifactId>
  <version>0.0.1</version>
  
  <!-- point #A, must set to kjar -->
  <packaging>kjar</packaging>

  <!-- ... -->

<dependencies>
<!-- maven artifact containing the object model or domain model objects the rules will be based on --> 
<dependency>
<groupId>com.acme</groupId>
<artifactId>object-model</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>my-rules</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>

<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>6.0.0.Final</version>
<extensions>true</extensions>
<dependencies>

<!-- point #B, the dependency must be repeated in here as well -->
<dependency>
<groupId>com.acme</groupId>
<artifactId>object-model</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

</dependencies>
</plugin>
</plugins>

<!-- The following is added to avoid Eclipse ERROR at the pom.xml line defining the kie-maven-plugin, by explicitly telling Eclipse to avoid run the plugin on Eclipse-build, leaving it trigger only when running Maven, eg "mvn package" or "mvn deploy", etc etc , see http://wiki.eclipse.org/M2E_plugin_execution_not_covered -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<versionRange>[6.0.0,)</versionRange>
<goals>
<goal>build</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
  <!-- ... -->
  
</project>


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Drool 6.0.0.Final, 2 question re kie-maven-plugin, please?

Mario Fusco
Hi,

unfortunately you're right. I reproduced the problem regarding the need of the duplicate dependencies declarations inside the plugin. I opened a ticket on jira to report this issue ( https://issues.jboss.org/browse/DROOLS-373 ) and already pushed a fix on the master branch for it ( https://github.com/droolsjbpm/drools/commit/b8a952e88 ).

Thanks a lot for having reported this,
Mario
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Drool 6.0.0.Final, 2 question re kie-maven-plugin, please?

tari-manga
Thanks a lot for the fix !
Ciao,
MM


On Mon, Dec 9, 2013 at 7:53 PM, Mario Fusco <[hidden email]> wrote:
Hi,

unfortunately you're right. I reproduced the problem regarding the need of
the duplicate dependencies declarations inside the plugin. I opened a ticket
on jira to report this issue ( https://issues.jboss.org/browse/DROOLS-373 )
and already pushed a fix on the master branch for it (
https://github.com/droolsjbpm/drools/commit/b8a952e88 ).

Thanks a lot for having reported this,
Mario



--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-Drool-6-0-0-Final-2-question-re-kie-maven-plugin-please-tp4027117p4027174.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Drool 6.0.0.Final, 2 question re kie-maven-plugin, please?

tari-manga
Ciao, Happy New Year !

I've appended comments and example project file to DROOLS-373[1] , because despite now using 6.0.1.Final it still does not work, at least for me, I still have to double-declare the dependency as a normal dependency but also within the kie-maven-plugin declaration.

Could somebody have a look, referencing the attached example project, and kindly let me know if either it's me really on a difficult relationship with Maven, or actually is this jira to be reopened, please? =)

Thanks!
Ciao
MM



On Tue, Dec 10, 2013 at 7:57 PM, Matteo Mortari <[hidden email]> wrote:
Thanks a lot for the fix !
Ciao,
MM


On Mon, Dec 9, 2013 at 7:53 PM, Mario Fusco <[hidden email]> wrote:
Hi,

unfortunately you're right. I reproduced the problem regarding the need of
the duplicate dependencies declarations inside the plugin. I opened a ticket
on jira to report this issue ( https://issues.jboss.org/browse/DROOLS-373 )
and already pushed a fix on the master branch for it (
https://github.com/droolsjbpm/drools/commit/b8a952e88 ).

Thanks a lot for having reported this,
Mario



--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-Drool-6-0-0-Final-2-question-re-kie-maven-plugin-please-tp4027117p4027174.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users