You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Shane Witbeck <sh...@digitalsanctum.com> on 2009/09/09 18:19:48 UTC

how to set system variable for jetty?

I'm attempting to set a system variable so that it's available to the
web app I'm deploying to jetty. How is this done?

Thanks,

-Shane

Re: how to set system variable for jetty?

Posted by Rhett Sutphin <rh...@detailedbalance.net>.
Hi Shane,

On Sep 9, 2009, at 11:42 AM, Shane Witbeck wrote:

> Thanks for the quick response. I'm still having trouble and not sure I
> know what you mean by buildr automatically starting up?

I mean that, as I understand it, buildr can deploy to jetty in two  
ways: you can have a separate jetty process or you can have buildr  
automatically start up jetty for you when you call deploy.  I do the  
latter.  This is important because you need to set the system  
properties in the same process where the jetty server is running.

> Here's what I
> have:
>
> task("setvars") do
>      Java.java.lang.System.setProperty("SPG_CONFIG_DIR",  
> SPG_CONFIG_DIR)
>    end
>
>    task("jetty"=>["setvars", jetty.use]) do |task|
>      jetty.deploy("http://localhost:8080/mycontext", war)
>    end

That looks pretty similar to what I do, except that I don't depend on  
jetty.use.  I'm not sure what the implications of that are.  All of  
the examples I can find use it, so I'm not sure why I don't.

Oh, also, it might matter how you're running buildr -- I use standard  
ruby.  Things might be different on jruby.

Rhett

>
> Thanks again,
>
> -Shane
>
>
>
> On Wed, Sep 9, 2009 at 12:25 PM, Rhett Sutphin<rhett@detailedbalance.net 
> > wrote:
>> Hi Shane,
>>
>> On Sep 9, 2009, at 11:19 AM, Shane Witbeck wrote:
>>
>>> I'm attempting to set a system variable so that it's available to  
>>> the
>>> web app I'm deploying to jetty. How is this done?
>>
>> I do it this way:
>>
>> Java.java.lang.System.setProperty("logback.configurationFile",  
>> logconfig)
>>
>> I'm using jetty.deploy in the mode where buildr automatically  
>> starts up
>> jetty when deploy is called (i.e., not with jetty already running  
>> in a
>> separate process).  If you're not, I think you'll have to do the  
>> setProperty
>> call in the process where jetty starts up instead of where you  
>> deploy to it.
>>
>> Rhett
>>


Re: how to set system variable for jetty?

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
Hi Rhett,

Thanks for the quick response. I'm still having trouble and not sure I
know what you mean by buildr automatically starting up? Here's what I
have:

task("setvars") do
      Java.java.lang.System.setProperty("SPG_CONFIG_DIR", SPG_CONFIG_DIR)
    end

    task("jetty"=>["setvars", jetty.use]) do |task|
      jetty.deploy("http://localhost:8080/mycontext", war)
    end

Thanks again,

-Shane



On Wed, Sep 9, 2009 at 12:25 PM, Rhett Sutphin<rh...@detailedbalance.net> wrote:
> Hi Shane,
>
> On Sep 9, 2009, at 11:19 AM, Shane Witbeck wrote:
>
>> I'm attempting to set a system variable so that it's available to the
>> web app I'm deploying to jetty. How is this done?
>
> I do it this way:
>
> Java.java.lang.System.setProperty("logback.configurationFile", logconfig)
>
> I'm using jetty.deploy in the mode where buildr automatically starts up
> jetty when deploy is called (i.e., not with jetty already running in a
> separate process).  If you're not, I think you'll have to do the setProperty
> call in the process where jetty starts up instead of where you deploy to it.
>
> Rhett
>

Re: how to set system variable for jetty?

Posted by Rhett Sutphin <rh...@detailedbalance.net>.
Hi Shane,

On Sep 9, 2009, at 11:19 AM, Shane Witbeck wrote:

> I'm attempting to set a system variable so that it's available to the
> web app I'm deploying to jetty. How is this done?

I do it this way:

Java.java.lang.System.setProperty("logback.configurationFile",  
logconfig)

I'm using jetty.deploy in the mode where buildr automatically starts  
up jetty when deploy is called (i.e., not with jetty already running  
in a separate process).  If you're not, I think you'll have to do the  
setProperty call in the process where jetty starts up instead of where  
you deploy to it.

Rhett