Re: How Access a Class from Groovy

2012-03-02 Thread domi
Thats correct.
/Domi

On 03.03.2012, at 06:30, Frank Merrow wrote:

> So helpful . . . sort of . . .
> 
> So at first I could not find what you suggest . . . but after nosing around,
> I did find that if as an execution step of a job I use Groovy, I can in fact
> adjust the class path there for that job step.
> 
> Useful for the future, thank you.
> 
> However, I'm running under scriptler and wanted to add something to the
> class path for a particular script.
> 
> I'm guessing that means I need to adjust Jenkin's class path BEFORE I start
> Jenkins . . . that in the case of scriptler (and the Script Console) this
> isn't something dynamic that can be added to  without restarting Jenkins.
> 
> Is that correct?
> 
> Frank
> 
> -Original Message-
> From: jenkinsci-users@googlegroups.com
> [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Vojtech Juranek
> Sent: Tuesday, February 28, 2012 4:49 AM
> To: jenkinsci-users@googlegroups.com
> Subject: Re: How Access a Class from Groovy
> 
> What exactly are you trying to achieve? And where do you run groovy script
> using your Test class?
> 
> In general, compiles Test class need to be in groovy class path.
> Usually it's -cp option when running from command line, in Jenkins Groovy
> plugin there's special column in Advanced options to set up class path
> 
>> So I am new to Java, Groovy and Jenkins . . .
>> 
>> 
>> 
>> I have a simple test class working:
>> 
>> 
>> 
>> class Test {
>> 
>>  public String MyString() { return "This is my String"; }
>> 
>> }
>> 
>> 
>> 
>> I can compile it and call it from Java . . .
>> 
>> 
>> 
>> class HelloWorldApp {
>> 
>>  public static void main(String[] args) {
>> 
>>System.out.println("Hello World!"); // Display the string.
>> 
>>Test t = new Test();
>> 
>>System.out.println(t.MyString());
>> 
>>  }
>> 
>> }
>> 
>> 
>> 
>> The question is, how do I do that from Groovy and Jenkins?
>> 
>> 
>> 
>> Is there a magic directory this has to be put into or a way to change 
>> CLASSPATH (I've seen postings implying CLASSPATH isn't honored by
> Jenkins).
>> 
>> 
>> 
>> I get that I need to import it . . . but where do I need to put it or 
>> how do I configure Groovy so it knows where I put it?
>> 
>> 
>> 
>> Frank
> 



RE: How Access a Class from Groovy

2012-03-02 Thread Frank Merrow
So helpful . . . sort of . . .

So at first I could not find what you suggest . . . but after nosing around,
I did find that if as an execution step of a job I use Groovy, I can in fact
adjust the class path there for that job step.

Useful for the future, thank you.

However, I'm running under scriptler and wanted to add something to the
class path for a particular script.

I'm guessing that means I need to adjust Jenkin's class path BEFORE I start
Jenkins . . . that in the case of scriptler (and the Script Console) this
isn't something dynamic that can be added to  without restarting Jenkins.

Is that correct?

Frank

-Original Message-
From: jenkinsci-users@googlegroups.com
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Vojtech Juranek
Sent: Tuesday, February 28, 2012 4:49 AM
To: jenkinsci-users@googlegroups.com
Subject: Re: How Access a Class from Groovy

What exactly are you trying to achieve? And where do you run groovy script
using your Test class?

In general, compiles Test class need to be in groovy class path.
Usually it's -cp option when running from command line, in Jenkins Groovy
plugin there's special column in Advanced options to set up class path

> So I am new to Java, Groovy and Jenkins . . .
> 
> 
> 
> I have a simple test class working:
> 
> 
> 
> class Test {
> 
>   public String MyString() { return "This is my String"; }
> 
> }
> 
> 
> 
> I can compile it and call it from Java . . .
> 
> 
> 
> class HelloWorldApp {
> 
>   public static void main(String[] args) {
> 
> System.out.println("Hello World!"); // Display the string.
> 
> Test t = new Test();
> 
> System.out.println(t.MyString());
> 
>   }
> 
> }
> 
> 
> 
> The question is, how do I do that from Groovy and Jenkins?
> 
> 
> 
> Is there a magic directory this has to be put into or a way to change 
> CLASSPATH (I've seen postings implying CLASSPATH isn't honored by
Jenkins).
> 
> 
> 
> I get that I need to import it . . . but where do I need to put it or 
> how do I configure Groovy so it knows where I put it?
> 
> 
> 
> Frank



Re: How Access a Class from Groovy

2012-02-28 Thread Vojtech Juranek
What exactly are you trying to achieve? And where do you run groovy script 
using your Test class?

In general, compiles Test class need to be in groovy class path.
Usually it's -cp option when running from command line, in Jenkins Groovy 
plugin there's special column in Advanced options to set up class path

> So I am new to Java, Groovy and Jenkins . . .
> 
> 
> 
> I have a simple test class working:
> 
> 
> 
> class Test {
> 
>   public String MyString() { return "This is my String"; }
> 
> }
> 
> 
> 
> I can compile it and call it from Java . . .
> 
> 
> 
> class HelloWorldApp {
> 
>   public static void main(String[] args) {
> 
> System.out.println("Hello World!"); // Display the string.
> 
> Test t = new Test();
> 
> System.out.println(t.MyString());
> 
>   }
> 
> }
> 
> 
> 
> The question is, how do I do that from Groovy and Jenkins?
> 
> 
> 
> Is there a magic directory this has to be put into or a way to change
> CLASSPATH (I've seen postings implying CLASSPATH isn't honored by Jenkins).
> 
> 
> 
> I get that I need to import it . . . but where do I need to put it or how
> do I configure Groovy so it knows where I put it?
> 
> 
> 
> Frank


How Access a Class from Groovy

2012-02-27 Thread Frank Merrow
So I am new to Java, Groovy and Jenkins . . .

 

I have a simple test class working:

 

class Test {

  public String MyString() { return "This is my String"; }

}

 

I can compile it and call it from Java . . .

 

class HelloWorldApp {

  public static void main(String[] args) {

System.out.println("Hello World!"); // Display the string.

Test t = new Test();

System.out.println(t.MyString());

  }

}

 

The question is, how do I do that from Groovy and Jenkins?

 

Is there a magic directory this has to be put into or a way to change
CLASSPATH (I've seen postings implying CLASSPATH isn't honored by Jenkins).

 

I get that I need to import it . . . but where do I need to put it or how do
I configure Groovy so it knows where I put it?

 

Frank