Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-12 Thread Mario Fusco
Hi Vimal,

By default maven reads 2 settings.xml files: the one located in your M2_HOME
and the one in your local repository that usually is under ${user_home}/.m2,
so yes, to make this works you should set the M2_HOME environment variable.

However you can override this default using the kie.maven.settings.custom
system property. In other words you can point at any xml file in your file
system by starting the JVM with a flag like

-Dkie.maven.settings.custom=/home/myuser/myfolder/mysettings.xml

I hope this helps,
Mario



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027246.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-12 Thread vimalkansal
Thanks a lot Marion, that is exactly what I was looking for. 

Vimal



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027247.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-12 Thread Mark Proctor
just a reminder
——
There is problem, fixed in master, for remote jars. The KieRepository 
currently, when using kie-ci, doesn’t obey the settings.xml active profiles. 
This means it is not recognising the remote configured repositories. 

While this is fixed, and we’ll have binaries out in about 2 weeks, it means for 
now KieRepository can only resolve jars already in the local m2_repo.

the jira
https://issues.jboss.org/browse/DROOLS-367


Mark
On 12 Dec 2013, at 09:46, vimalkansal vimalkan...@yahoo.com wrote:

 Thanks a lot Marion, that is exactly what I was looking for. 
 
 Vimal
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027247.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-12 Thread vimalkansal
Thanks a lot Mark.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027258.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-12 Thread Mark Proctor
all fixed in the daily build, give it a try please.
http://download.jboss.org/drools/release/snapshot/6.0.x/

Mark
On 12 Dec 2013, at 19:08, vimalkansal vimalkan...@yahoo.com wrote:

 Thanks a lot Mark.
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027258.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-12 Thread vimalkansal
Thanks Mark. 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027262.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Hi Manstis,

I am going to try out what you have suggested, but I have the following
questions :

In the first instance this answer looked alright, but then how is it a
dynamic module? I was under the impression (as mentioned in the doco also)
that by having kie-ci on the classpath, it can pull down the jars
dynamically from maven repo with a statement like kContainer =
ks.newKieContainer(ks.newReleaseId(com.xyz, HelloWorld,
1.0.0-SNAPSHOT));

Can you please correct me if my understanding is wrong. And, if my
understanding is correct, how does kie-ci know about my maven repo?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027229.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Hi Manstis,

Also, I am running another instane of KIE-WB which points to the default
M2_REPO i.e /home/user/.m2 and I I have done build and deploy to push the
built jar to this repo.

Then I have written a Java SE application and I am able to successfully
dynamically download the jar and run the rule without having the above
changes you mentioned, please see my pom.xml attached pom.xml
http://drools.46999.n3.nabble.com/file/n4027230/pom.xml  



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027230.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
And here is how my Java code looks like :

public class HelloWorldRuleExecutor {

public static void main(String[] args) {
// TODO Auto-generated method stub
String msg = xxx;
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = null;
kContainer = ks.newKieContainer(ks.newReleaseId(au.com.xyz,
HelloWorld, 1.0.0-SNAPSHOT));
if (kContainer == null)
System.out.println(Null);
 KieSession kSession = kContainer.newKieSession();
 //kSession.addEventListener( new 
DebugRuleRuntimeEventListener());
//kSession.setGlobal(message,msg);
//defaultStatelessKieSession
 kSession.fireAllRules();
// System.out.println(msg);

}

}



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027232.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
I assume .m2, kie-wb and your application are all running on the same
computer? Delete from your .m2 and try again (without having the repository
in your pom). It should fail.

When everything is in the same computer it is harder (for you) to replicate
a remote maven repository. Deleting from .m2 can help achieve this.

That said this thread is becoming a general catch all for multiple issues.

Can you please clearly state what the problem now is?

Sent on the move
On 11 Dec 2013 22:28, vimalkansal vimalkan...@yahoo.com wrote:

 Hi Manstis,

 Also, I am running another instane of KIE-WB which points to the default
 M2_REPO i.e /home/user/.m2 and I I have done build and deploy to push the
 built jar to this repo.

 Then I have written a Java SE application and I am able to successfully
 dynamically download the jar and run the rule without having the above
 changes you mentioned, please see my pom.xml attached pom.xml
 http://drools.46999.n3.nabble.com/file/n4027230/pom.xml



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027230.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Yes, you are correct, my application, .m2 and kie-wb are running on the same
machine., and I can see your point. But in the different instance(the
scenario that I originally described) I have a web application, .m2 and
kie-web running on the same machine and my code is not able to download the
jar file from local .m2 repo. I may also add that these 2 scenarios are on
different machines :

Machine 1: Java SE App, .m2, Kie-wb with M2_HOME env variable setup  -- this
works

Machine 2: Java Web app, maven repo, Kie-wb (I am not sure if M2_HOME is
setup, as this is different developers machine) 

I had a brief look at org.kie.scanner.embedder.MavenSettings.java and I have
the feeling that on machine 2 (M2_HOME) is not set up, so basically the
embedded maven is not pointing to the same maven repo to which Kie-wb is. I
will try that when the developer is back. 

So as you can see, I am still working with local maven repo scenario. Now
coming back to what you have suggested(for remote repo), i.e include the
remote repo and the dependency on artifact (containing rules) in my
applications POM file. Now this is confusing : Isn't the pom file used only
at build stage when it will download any dependencies from the repositories
specified in pom.xml, settings.xml? So in a way when I declare the
dependency on my rule artifact in my applications's pom.xml, I am
downloading the artifact at compile time. In other words when my application
starts running, by that time it already has that artifact(i.e rules). After
reading the doc I had the impression that by having kie-ci on classpath of
the web app, web app should be able to download the artifact at run time
rather than compile time. 

Thx

Vimal






--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027234.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
You don't need to run on 2 machines; I was trying to explain why the
dependency could be resolved in kie-wb without the additional repository
element in your consuming projects pom.

You are correct that the pom is used at build time. There were lots of
emails recently about your enquiry that showed the solution.  I'll ask a
colleague to forward to this list.

Sent on the move
On 12 Dec 2013 00:05, vimalkansal vimalkan...@yahoo.com wrote:

 Yes, you are correct, my application, .m2 and kie-wb are running on the
 same
 machine., and I can see your point. But in the different instance(the
 scenario that I originally described) I have a web application, .m2 and
 kie-web running on the same machine and my code is not able to download the
 jar file from local .m2 repo. I may also add that these 2 scenarios are on
 different machines :

 Machine 1: Java SE App, .m2, Kie-wb with M2_HOME env variable setup  --
 this
 works

 Machine 2: Java Web app, maven repo, Kie-wb (I am not sure if M2_HOME is
 setup, as this is different developers machine)

 I had a brief look at org.kie.scanner.embedder.MavenSettings.java and I
 have
 the feeling that on machine 2 (M2_HOME) is not set up, so basically the
 embedded maven is not pointing to the same maven repo to which Kie-wb is. I
 will try that when the developer is back.

 So as you can see, I am still working with local maven repo scenario. Now
 coming back to what you have suggested(for remote repo), i.e include the
 remote repo and the dependency on artifact (containing rules) in my
 applications POM file. Now this is confusing : Isn't the pom file used only
 at build stage when it will download any dependencies from the repositories
 specified in pom.xml, settings.xml? So in a way when I declare the
 dependency on my rule artifact in my applications's pom.xml, I am
 downloading the artifact at compile time. In other words when my
 application
 starts running, by that time it already has that artifact(i.e rules). After
 reading the doc I had the impression that by having kie-ci on classpath of
 the web app, web app should be able to download the artifact at run time
 rather than compile time.

 Thx

 Vimal






 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027234.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Thanks manstis. I will be eagerly looking forward to the solution.

Vimal



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027238.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
Sent.. email titled something like remote jars and dynamic modules.

Sent on the move
On 12 Dec 2013 07:26, vimalkansal vimalkan...@yahoo.com wrote:

 Thanks manstis. I will be eagerly looking forward to the solution.

 Vimal



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027238.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
Please note this relates to remote maven repositories; I.e. where kie-wb
(and it's maven repo) are on one machine; and your consuming application on
another machine.

If everything is on a single machine use of settings.xml is not needed as
artifacts should be resolved against .m2.

There is a thread asking about dynamic rules with .m2 running on this
mailing list in parallel to this one! I recommend reading those too.

Sent on the move
On 12 Dec 2013 07:32, Michael Anstis michael.ans...@gmail.com wrote:

 Sent.. email titled something like remote jars and dynamic modules.

 Sent on the move
 On 12 Dec 2013 07:26, vimalkansal vimalkan...@yahoo.com wrote:

 Thanks manstis. I will be eagerly looking forward to the solution.

 Vimal



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027238.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-10 Thread Michael Anstis
Have you add the workbench maven repository to your web-app's pom and the
project you've compiled in the workbench as a decency?

Have you disabled security for the maven repository or have you configured
maven preemptive authentication in settings.xml?

There were a number of emails last week with exactly the same question -
and solutions given.

Sent on the move
On 11 Dec 2013 05:24, vimalkansal vimalkan...@yahoo.com wrote:

 Hi,

 I have an instance of Kie-WB running and I have started it with property
 org.guvnor.m2repo.dir set to some non default location (i.e not in
 /../home/.2).  I am able to use the KIE WB to build and deploy the
 project
 to this repository. Then I have built a web application ( I have declared
 the dependency on org.kie/kie-ci module and I have verified that this jar
 is
 getting packaged under WEB-INF/lib folder of my .war file). So with this
 setup, when I have a code like this in my web application :

 KieServices ks = KieServices.Factory.get();
 KieContainer kContainer = null;
 *kContainer = ks.newKieContainer(ks.newReleaseId(com.xyz, HelloWorld,
 1.0.0-SNAPSHOT));*

 it seems to wait inordinately long at the highlighted line and then throws
 up an exception to the telling can't get the default Kie Session.  My
 question :

 Do I have to tell the web application about the location of the maven
 repo? if yes how?

 Thx

 Vimal



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-10 Thread vimalkansal
Yup, I think that must be the issue, I simply forgot to do that.

Thx a lot

Vimal



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027215.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users