<div dir="ltr">Ciao, with premise I&#39;m not a Maven expert...<div><div><br></div><div>I&#39;m following now the new recommended version for 6.0 KIE project/module development as documented in [1] by generating a new maven archetype &quot;quickstart&quot; 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:</div>

<div>A. the packaging must be changed to &quot;kjar&quot;</div><div>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 &lt;dependencies&gt;, but the exact same dependencies MUST ALSO be also declared within the kie-maven-plugin &lt;plugin&gt; &lt;dependencies&gt; as well.</div>

</div><div><br></div><div>Failing to do so, would imply that, respectively:</div><div>A. when you run Maven with the default &quot;mvn package&quot; or &quot;mvn deploy&quot; etc, the kie-maven-plugin would not trigger</div>

<div>B. kie-maven-plugin will fail the build because unable to resolve the &quot;external&quot; 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 &#39;classname&#39;]<br>

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

<div><br></div><div>Thanks if somebody can feedback on this,</div><div>Ciao</div><div>MM</div><div><br></div><div>I&#39;m making reference to:</div><div>[1] <a href="http://docs.jboss.org/drools/release/6.0.0.Final/drools-docs/html_single/#KIEModuleIntroductionBuildingIntroductionSection">http://docs.jboss.org/drools/release/6.0.0.Final/drools-docs/html_single/#KIEModuleIntroductionBuildingIntroductionSection</a></div>

<div><br></div><div>For reference, here is an example pom.xml I&#39;m using:</div><div><br></div><div><div>&lt;project xmlns=&quot;<a href="http://maven.apache.org/POM/4.0.0">http://maven.apache.org/POM/4.0.0</a>&quot; xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;  xsi:schemaLocation=&quot;<a href="http://maven.apache.org/POM/4.0.0">http://maven.apache.org/POM/4.0.0</a> <a href="http://maven.apache.org/xsd/maven-4.0.0.xsd">http://maven.apache.org/xsd/maven-4.0.0.xsd</a>&quot;&gt;</div>

<div>  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;</div><div><br></div><div>  &lt;groupId&gt;com.acme&lt;/groupId&gt;</div><div>  &lt;artifactId&gt;my-rules&lt;/artifactId&gt;</div><div>  &lt;version&gt;0.0.1&lt;/version&gt;</div>

<div>  </div><div>  &lt;!-- point #A, must set to kjar --&gt;</div><div>  &lt;packaging&gt;kjar&lt;/packaging&gt;</div><div><br></div><div>  &lt;!-- ... --&gt;</div><div><br></div><div><span class="" style="white-space:pre">        </span>&lt;dependencies&gt;</div>

<div><span class="" style="white-space:pre">                </span>&lt;!-- maven artifact containing the object model or domain model objects the rules will be based on --&gt; </div><div><span class="" style="white-space:pre">                </span>&lt;dependency&gt;</div>

<div><span class="" style="white-space:pre">                        </span>&lt;groupId&gt;com.acme&lt;/groupId&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;artifactId&gt;object-model&lt;/artifactId&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;</div>

<div><span class="" style="white-space:pre">                </span>&lt;/dependency&gt;</div><div><br></div><div><span class="" style="white-space:pre">                </span>&lt;dependency&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;groupId&gt;junit&lt;/groupId&gt;</div>

<div><span class="" style="white-space:pre">                        </span>&lt;artifactId&gt;junit&lt;/artifactId&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;version&gt;4.11&lt;/version&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;scope&gt;test&lt;/scope&gt;</div>

<div><span class="" style="white-space:pre">                </span>&lt;/dependency&gt;</div><div><span class="" style="white-space:pre">        </span>&lt;/dependencies&gt;</div><div><br></div><div><span class="" style="white-space:pre">        </span>&lt;build&gt;</div>

<div><span class="" style="white-space:pre">                </span>&lt;finalName&gt;my-rules&lt;/finalName&gt;</div><div><span class="" style="white-space:pre">                </span>&lt;plugins&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;plugin&gt;</div>

<div><span class="" style="white-space:pre">                                </span>&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;configuration&gt;</div><div><span class="" style="white-space:pre">                                        </span>&lt;source&gt;1.7&lt;/source&gt;</div>

<div><span class="" style="white-space:pre">                                        </span>&lt;target&gt;1.7&lt;/target&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;/configuration&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;/plugin&gt;</div>

<div><span class="" style="white-space:pre">                        </span>&lt;plugin&gt;</div><div><br></div><div><span class="" style="white-space:pre">                                </span>&lt;groupId&gt;org.kie&lt;/groupId&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;artifactId&gt;kie-maven-plugin&lt;/artifactId&gt;</div>

<div><span class="" style="white-space:pre">                                </span>&lt;version&gt;6.0.0.Final&lt;/version&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;extensions&gt;true&lt;/extensions&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;dependencies&gt;</div>

<div><br></div><div><span class="" style="white-space:pre">                                        </span>&lt;!-- point #B, the dependency must be repeated in here as well --&gt;</div><div><span class="" style="white-space:pre">                                        </span>&lt;dependency&gt;</div>

<div><span class="" style="white-space:pre">                                                </span>&lt;groupId&gt;com.acme&lt;/groupId&gt;</div><div><span class="" style="white-space:pre">                                                </span>&lt;artifactId&gt;object-model&lt;/artifactId&gt;</div><div><span class="" style="white-space:pre">                                                </span>&lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;</div>

<div><span class="" style="white-space:pre">                                        </span>&lt;/dependency&gt;</div><div><br></div><div><span class="" style="white-space:pre">                                </span>&lt;/dependencies&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;/plugin&gt;</div>

<div><span class="" style="white-space:pre">                </span>&lt;/plugins&gt;</div><div><br></div><div><span class="" style="white-space:pre">                </span>&lt;!-- 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 &quot;mvn package&quot; or &quot;mvn deploy&quot;, etc etc , see <a href="http://wiki.eclipse.org/M2E_plugin_execution_not_covered">http://wiki.eclipse.org/M2E_plugin_execution_not_covered</a> --&gt;</div>

<div><span class="" style="white-space:pre">                </span>&lt;pluginManagement&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;plugins&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;plugin&gt;</div>

<div><span class="" style="white-space:pre">                                        </span>&lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;</div><div><span class="" style="white-space:pre">                                        </span>&lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;</div>

<div><span class="" style="white-space:pre">                                        </span>&lt;version&gt;1.0.0&lt;/version&gt;</div><div><span class="" style="white-space:pre">                                        </span>&lt;configuration&gt;</div><div><span class="" style="white-space:pre">                                                </span>&lt;lifecycleMappingMetadata&gt;</div>

<div><span class="" style="white-space:pre">                                                        </span>&lt;pluginExecutions&gt;</div><div><span class="" style="white-space:pre">                                                                </span>&lt;pluginExecution&gt;</div><div><span class="" style="white-space:pre">                                                                        </span>&lt;pluginExecutionFilter&gt;</div>

<div><span class="" style="white-space:pre">                                                                                </span>&lt;groupId&gt;org.kie&lt;/groupId&gt;</div><div><span class="" style="white-space:pre">                                                                                </span>&lt;artifactId&gt;kie-maven-plugin&lt;/artifactId&gt;</div>

<div><span class="" style="white-space:pre">                                                                                </span>&lt;versionRange&gt;[6.0.0,)&lt;/versionRange&gt;</div><div><span class="" style="white-space:pre">                                                                                </span>&lt;goals&gt;</div><div><span class="" style="white-space:pre">                                                                                        </span>&lt;goal&gt;build&lt;/goal&gt;</div>

<div><span class="" style="white-space:pre">                                                                                </span>&lt;/goals&gt;</div><div><span class="" style="white-space:pre">                                                                        </span>&lt;/pluginExecutionFilter&gt;</div><div><span class="" style="white-space:pre">                                                                        </span>&lt;action&gt;</div>

<div><span class="" style="white-space:pre">                                                                                </span>&lt;ignore /&gt;</div><div><span class="" style="white-space:pre">                                                                        </span>&lt;/action&gt;</div><div><span class="" style="white-space:pre">                                                                </span>&lt;/pluginExecution&gt;</div>

<div><span class="" style="white-space:pre">                                                        </span>&lt;/pluginExecutions&gt;</div><div><span class="" style="white-space:pre">                                                </span>&lt;/lifecycleMappingMetadata&gt;</div><div><span class="" style="white-space:pre">                                        </span>&lt;/configuration&gt;</div>

<div><span class="" style="white-space:pre">                                </span>&lt;/plugin&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;/plugins&gt;</div><div><span class="" style="white-space:pre">                </span>&lt;/pluginManagement&gt;</div>

<div><span class="" style="white-space:pre">        </span>&lt;/build&gt;</div><div><span class="" style="white-space:pre">        </span></div><div>  &lt;!-- ... --&gt;</div><div>  </div><div>&lt;/project&gt;</div></div><div><br></div>

</div>