簡體   English   中英

遠程服務器上的貨運Maven

[英]Cargo Maven on Remote Server

我正在嘗試使用cargo Maven插件在遠程服務器上進行戰爭,但是我得到: [錯誤]無法執行目標org.codehaus.cargo:cargo-maven2-plugin:1.6.4:start(start-container)在項目portnet上:僅可以啟動本地容器-> [幫助1]

我有以下配置:

          <plugin>
             <groupId>org.codehaus.cargo</groupId>
             <artifactId>cargo-maven2-plugin</artifactId>
             <version>1.6.4</version>
             <configuration>
             <wait>false</wait>
               <container>
                  <containerId>tomcat8x</containerId>
                  <type>remote</type>                 
               </container>

               <configuration>
                  <type>runtime</type>
                     <files>
                        <copy>
                           <file>C:\apache-tomcat-8.5.20\conf\tomcat-users.xml</file>
                           <tofile>conf/tomcat-users.xml</tofile>
                           <configfile>true</configfile>
                           <overwrite>true</overwrite>
                        </copy>
                     </files>
                     <properties>
                        <cargo.hostname>remoteserver</cargo.hostname>
                        <cargo.servlet.port>8180</cargo.servlet.port>
                        <cargo.remote.username>user</cargo.remote.username>
                        <cargo.remote.password>passw</cargo.remote.password>                           <cargo.tomcat.manager.url>http://localhost:8180/manager</cargo.tomcat.manager.url>
                </properties>
                </configuration>

            <deployer>
                <type>remote</type>                 
            </deployer>

            <deployables>
                <deployable>
                   <type>war</type>
                   <properties>
                          <context>/portnet</context>
                    </properties>    
            </deployable>
            </deployables>

        </configuration>

            <executions>
              <!-- start server before integration tests -->
              <execution>
                <id>start-container</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <!-- stop server after integration tests -->
              <execution>
                <id>stop-container</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
    </plugins>

如果要使用遠程服務器,則可以使用以下兩個貨運目標:

  • deploy此目標用於將定義的可部署項部署到遠程服務器。
  • undeploy -此目標用於從遠程服務器取消部署已定義的可部署項目。

目標的startstop只能用於本地容器-生命周期由Cargo Maven插件直接控制的容器。

如果在配置中將<goal>start</goal>替換為<goal>deploy</goal> ,將<goal>stop</goal>替換為<goal>undeploy</goal>則應該擺脫此錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM