7

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

Vitek
  • 628
  • 3
  • 8
  • 15
  • What version of Jetty are you using? Cargo has remote deployer support for Jetty 6.x+ only (and only for the Maven 2 plugin). – Pascal Thivent Nov 09 '09 at 06:10
  • seems duplicate of http://stackoverflow.com/questions/2369851/hot-deploy-in-embedded-jetty – Aruna Mar 18 '12 at 14:42

3 Answers3

3

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?

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
kazanaki
  • 7,988
  • 8
  • 52
  • 79
0

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
  • 1
  • 1
0

For those of you using Windows, if you run into file locking errors, visit:

http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows

Windows locks the files Jetty loads into memory. The above link will show you how to prevent that.

harryovers
  • 3,087
  • 2
  • 34
  • 56
somid3
  • 680
  • 1
  • 7
  • 19
  • dead link! :( shouldn't answer questions with links like that – Nicholas DiPiazza Jul 17 '18 at 00:47
  • @NicholasDiPiazza you could just update the link with one from the internet archive. The original post was 6 years before your comment, it is quite common for links to go bad on older posts. – harryovers Dec 18 '18 at 16:15