Ciao Mario,
thank you for your feedback, I believe could be indeed Maven related, but frankly what led me raise the bug in the Drools Jira, it looks like this is an issue only when Drools is invoking the Maven API ? - all my other Maven workflows with 'mvn' builds command are working fine.
Indeed the complexity is due to the requirement where artifactId will be known only at runtime, in my case. That's why I've made that simple test project, because it would simulate the fetch from a remote maven repo - in that case I could parametrize the hardcoded artifactId String to a variable as well.
Here is a question concerning to your last feedback, please.
Assuming the .m2 local repository is missing completely the com\acme\drools6testmvnlatest.therules directory...
If I specify the remote Maven repo in the settings, the code example provided, should be able to remotely fetch and install from remote repository, right ?
Because despite my maven remote repositories are specified in the ~/.m2/settings.xml or in the same file passed as the -Dkie.maven.settings.custom= system property, still get the same problem, either I explicit version number, either I ask for RELEASE or LATEST.
Example:
D:\inbox>java -jar -Dkie.maven.settings.custom=D:/inbox/settings.xml drools6testmvnlatest.thestandaloneengine-jar-with-dependencies.jar 0.0.2
2014-02-03 18:28:57,017 [pool-1-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 8
2014-02-03 18:28:57,361 [pool-3-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 8
Exception in thread "main" java.lang.RuntimeException: Cannot find KieModule: com.acme:drools6testmvnlatest.therules:0.0.2
at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:86)
at com.acme.drools6testmvnlatest.thestandaloneengine.App.main(App.java:24)
I've also tried the different combination of windows-horror-slash, just to be sure, but result is always the same.
I attach the content of my settings.xml file below, in case I'm missing something stupid.
If you can kindly advise what's your perspective, please, because I've rechecked the documentation several times but frankly I think I'm doing all by the book, yet not able to making it recognize the remote maven repo ?
Thanks;
Ciao
MM
<profiles>
<profile>
<id>nexus-hostname-nexus</id>
<repositories>
<repository>
<id>nexus-hostname-nexus</id>
<name>nexus-hostname-nexus</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>nexus-hostname-nexus-snapshots</id>
<name>nexus-hostname-nexus</name>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus-hostname-nexus</activeProfile>
</activeProfiles>
</settings>