views:

2646

answers:

2

Hi,

I have a web application which is running on jetty. Continues builds are built on hudson. I would like to make a hot deploy on demand from hudson.

I found cargo plugin which should be able to do so but cargo's web doesn't show any complete example how to do it - for remote jetty server - may be I miss it?

What do you suggest? Do you have any other better solution?

thank you,

Vitek

+1  A: 

Cargo's documentation shows that it is possible to deploy to jetty via maven 2.

And here is the configuration.

I assume you tried this? What was the problem?

kazanaki
A: 

Jetty : can be run as as standalone : just remote copy the war you build . Standalone Jetty instances can be run independent ports .

Yml : eg

<Set name="ThreadPool">
  -->
  <New class="org.mortbay.thread.QueuedThreadPool">
    <Set name="minThreads">10</Set>
    <Set name="maxThreads">50</Set>
    <Set name="lowThreads">5</Set>
    <Set name="SpawnOrShrinkAt">2</Set>
  </New>

</Set>




<Call name="addConnector">
  <Arg>
      <New class="org.mortbay.jetty.nio.SelectChannelConnector">
        <Set name="host"><SystemProperty name="jetty.host" default="0.0.0.0" /></Set>
        <Set name="port"><SystemProperty name="jetty.port" default="8880"/></Set>
        <Set name="maxIdleTime">300000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="statsOn">false</Set>
        <Set name="confidentialPort">8441</Set>
        <Set name="lowResourcesConnections">20000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
      </New>
  </Arg>
</Call>

<Set name="handler">
  <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
    <Set name="handlers">
     <Array type="org.mortbay.jetty.Handler">
       <Item>
         <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
       </Item>
       <Item>
         <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
       </Item>
       <Item>
         <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
       </Item>
     </Array>
    </Set>
  </New>
</Set>

<Call name="addLifeCycle">
  <Arg>
    <New class="org.mortbay.jetty.deployer.ContextDeployer">
      <Set name="contexts"><Ref id="Contexts"/></Set>
      <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts/</Set>
      <Set name="scanInterval">1</Set>
    </New>
  </Arg>
</Call>

<Set name="UserRealms">
  <Array type="org.mortbay.jetty.security.UserRealm">
    <Item>
      <New class="org.mortbay.jetty.security.HashUserRealm">
        <Set name="name">Test Realm</Set>
        <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
        <Set name="refreshInterval">0</Set>
      </New>
    </Item>
  </Array>
</Set>

<Ref id="RequestLog">
  <Set name="requestLog">
    <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
      <Set name="filename"><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Set>
      <Set name="filenameDateFormat">yyyy_MM_dd</Set>
      <Set name="retainDays">90</Set>
      <Set name="append">true</Set>
      <Set name="extended">true</Set>
      <Set name="logCookies">false</Set>
      <Set name="LogTimeZone">GMT</Set>
    </New>
  </Set>
</Ref>

<Set name="stopAtShutdown">true</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">true</Set>
<Set name="gracefulShutdown">1000</Set>

chetan