2011-01-31 157 views
1

我想用哈德森Maven插件這樣的應用程序部署到JBoss 6服務器:如何使用hudson + maven + cargo將應用程序部署到jboss服務器?

  1. 哈德森呼籲行家乾淨的安裝任務
  2. 在pom.xml文件中定義的貨物插件(1.0版本。 6)
  3. 貨物插件已經定義的執行重新部署相目標安裝停止和啓動(按照這個順序)

,一切工作正常 - 該項目被清洗,然後安裝,然後JBoss服務器停止(使用貨物:停止)並重新開始(使用貨物:開始)。開始階段的目標是將我的項目部署到jboss的戰爭中。當我測試我的網絡時,它可以工作,並且所有更改都存在。

唯一的問題是,在Jboss服務器啓動後,maven不能成功完成執行,因爲它顯示消息「[INFO]按Ctrl-C停止容器...」,並等待按下Ctrl -C。這是標準貨物:啓動行爲。結果是,哈德森的工作並沒有順利完成。

我現在要求的是som這種小問題的解決方法。我需要很長時間(大約16個小時)才能到達這個州,如果我不得不完全重做它,我不會感到高興。

我的想法怎麼能去的(但我沒能到google什麼有用的東西):

  • 力哈德森在後臺運行Maven任務
  • 力的貨物在後臺運行JBoss的(一些菌種,叉,jvm的參數,JBoss的運行參數)
  • 力行家在後臺運行任務

爲什麼我嘗試這種解決方案的原因是,我想有JBoss的對T永久運行他的服務器和貨物遠程部署選項對我來說並不好,因爲它使用了太多的系統資源。此解決方案應該適用於安裝項目,然後重新啓動服務器(停止 - 啓動)。

感謝您的任何幫助。這裏是我的貨物插件配置:

<plugin> 
      <groupId>org.codehaus.cargo</groupId> 
      <artifactId>cargo-maven2-plugin</artifactId> 
      <version>1.0.6</version> 
      <configuration> 
       <container> 
        <containerId>jboss6x</containerId> 
        <append>false</append> 
        <timeout>300000</timeout> 
        <home>/atteq/jboss</home> 
       </container> 
       <configuration> 
        <properties> 
         <cargo.servlet.port>8080</cargo.servlet.port> 
         <cargo.jboss.configuration>atteq-minimal</cargo.jboss.configuration> 
         <cargo.logging>high</cargo.logging> 
         <cargo.rmi.port>1099</cargo.rmi.port> 
         <cargo.jvmargs>-XX:PermSize=512m -XX:MaxPermSize=1024 
         -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled 
         -XX:+CMSClassUnloadingEnabled</cargo.jvmargs> 
         <cargo.runtime.args>--host 0.0.0.0</cargo.runtime.args> 

        </properties> 
         <type>existing</type> 
        <home>/atteq/jboss/server/atteq-minimal</home> 
       <deployables> 
        <deployable> 
         <groupId>roztocto</groupId> 
         <artifactId>roztocto</artifactId> 
         <type>war</type> 
        </deployable> 
       </deployables> 

        </configuration> 
       </configuration> 
      <executions> 
       <execution> 
        <id>redeploy</id> 
        <phase>install</phase> 
        <goals> 
         <goal>stop</goal> 
         <goal>start</goal> 
        </goals> 
       </execution> 
      </executions> 
      <dependencies> 
        <dependency> 
         <groupId>org.codehaus.cargo</groupId> 
         <artifactId>cargo-core-tools-jboss-deployer-5.1-and-onwards</artifactId> 
         <version>1.0.6</version> 
        </dependency> 
       <dependency> 
        <groupId>org.jboss.jbossas</groupId> 
        <artifactId>jboss-as-profileservice-client</artifactId> 
        <version>6.0.0.Final</version> 
        <type>pom</type> 
       </dependency> 

        <dependency> 
         <groupId>org.jboss.profileservice</groupId> 
         <artifactId>jboss-profileservice-spi</artifactId> 
         <version>0.2.2</version> 
        </dependency> 

        <dependency> 
         <groupId>org.jboss.jbossas</groupId> 
         <artifactId>jboss-as-client</artifactId> 
         <version>6.0.0.Final</version> 
         <type>pom</type> 
        </dependency> 
      </dependencies> 

     </plugin> 
+0

您是否發現此問題的解決方案?我也試圖達到同樣的目的。 – Sahil 2011-03-03 02:05:12

回答

2

如何將<wait>屬性設置爲true?按照docs

<wait> Decides if Cargo should wait after the container is 
      started or not         Defaults to true 
+0

看起來不錯,但它不是 - 當您將設置爲false時,容器會啓動然後停止(它不會等待Ctrl-c停止,它會立即停止)。我需要我的容器(jboss)在啓動後繼續運行。 – Lubbo 2011-01-31 12:23:59

1

哈德森監視所有正在運行的進程,並不會考慮構建完成,直到他們全部結束。我對貨物不熟悉,但這裏是我對哈德森經歷的筆記。要獲得通過監視器網的過程可能需要:

  • 運行JBoss的背景
  • 設置環境變量-Dhudson.util.ProcessTreeKiller.disable到真正在你的哈德遜配置
  • 集BUILD_ID = dontKillMe作爲shell環境變量

查看Hudson wiki here。 或Jenkins wiki here

詹金斯和哈德森基本上是一樣的東西,但雙方最近分裂。我會讓你閱讀Jenkins組和Oracle Hudson組的詳細信息。編輯:也SO問題How to choose between Hudson and Jenkins?

相關問題