2010-07-13 21 views
2

我試圖貨了maven2-插件,但我不jboss5x我pom.xml的部署是如何使用cargo-maven2-plugin部署到jboss as5?

<plugin> 
      <groupId>org.codehaus.cargo</groupId> 
      <artifactId>cargo-maven2-plugin</artifactId> 
      <version>1.0.2</version> 
      <configuration> 
       <container> 
        <containerId>jboss51x</containerId> 
        <home>E:\JavaWorkingTools\JBoss\jboss-5.1.0.GA</home> 
        <log>${basedir}/target/jboss5.1.x.logs/cargo.log</log> 
        <timeout>300000</timeout> <!-- 5 minutes --> 
        <systemProperties> 
         <jboss.server.log.threshold>INFO</jboss.server.log.threshold> 
        </systemProperties> 
       </container> 
       <configuration> 
        <type>existing</type> 
        <home>${project.build.directory}/target/jboss51x</home> 
        <properties> 
         <cargo.jvmargs>-XX:PermSize=512m -XX:MaxPermSize=1024 
          -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled 
          -XX:+CMSClassUnloadingEnabled</cargo.jvmargs> 
        </properties> 
       </configuration> 
       <deployer> 
        <type>installed</type> 
        <deployables> 
         <deployable> 
          <groupId>${project.groupId}</groupId> 
          <artifactId>${project.artifactId}</artifactId> 
          <type>war</type> 

          <!-- 
           <pingURL>http://localhost:8080/${artifactId}</pingURL> 
           <pingTimeout>300000</pingTimeout> 
          --> 
          <pingURL>http://localhost:8080/${project.artifactId}/index.jsp</pingURL> 
          <properties> 
           <context>/${project.artifactId}</context> 
          </properties> 
         </deployable> 
        </deployables> 
       </deployer> 
      </configuration> 
      <executions> 
       <execution> 
        <id>start-container</id> 
        <phase>pre-integration-test</phase> 
        <goals> 
         <goal>start</goal> 
        </goals> 
       </execution> 
       <execution> 
        <id>stop-container</id> 
        <phase>post-integration-test</phase> 
        <goals> 
         <goal>stop</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 

我跑貨:部署啓動或cargodeployer部署是錯誤

貨物:部署啓動錯誤信息是:

Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.2:deployer-start (default-cli) on project SSH2Maven: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.0.2:deployer-start failed: Not supported -> [Help 1] 

和cargodeployer部署

The Deployable state is thus unknown. -> 

我讀了一個Deploying to a running container但我不知道如何在jboss5中解析webapp:(

回答

2

你的配置有一些奇怪的東西。由於您使用的是已安裝的現有容器,因此我希望能夠看到通向其主目錄的路徑,而不是目標下的目錄。下面是我使用的配置:

<plugin> 
    <groupId>org.codehaus.cargo</groupId> 
    <artifactId>cargo-maven2-plugin</artifactId> 
    <version>1.0.2</version> 
    <configuration> 
     <container> 
     <containerId>jboss51x</containerId> 
     <append>false</append> 
     <log>${project.build.directory}/logs/jboss51x.log</log> 
     <output>${project.build.directory}/logs/jboss51x.out</output> 
     <timeout>300000</timeout><!-- 5 minutes --> 
     </container> 
     <configuration> 
     <type>existing</type> 
     <home>/path/to/jboss-5.1.0.GA</home> 
     <properties> 
      <cargo.servlet.port>8080</cargo.servlet.port> 
      <cargo.jboss.configuration>default</cargo.jboss.configuration> 
      <cargo.rmi.port>1099</cargo.rmi.port> 
      <cargo.logging>high</cargo.logging> 
     </properties> 
     <deployables> 
      <!-- application to deploy --> 
      <deployable> 
      <groupId>${project.groupId}</groupId> 
      <artifactId>myapp</artifactId> 
      <type>war</type> 
      <!-- 
      <properties> 
       <context>acontext</context> 
      </properties> 
      --> 
      </deployable> 
     </deployables> 
     </configuration> 
    </configuration> 
    </plugin> 
+0

如果你第一次運行的貨物:開始運行容器和第二輪貨物:部署部署部署在JBoss中的web應用和最後一個輸入地址http://本地主機:8080/MyApp的/ index.jsp,你可以訪問嗎? 我按照上面的步驟,瀏覽器出現404 – EdwardLau 2010-07-13 18:00:02

+0

路徑首頁我用絕對路徑 – EdwardLau 2010-07-13 18:01:30