maven 通過cargo配置運行到web伺服器

來源:互聯網
上載者:User

標籤:style   http   color   io   os   java   ar   art   sp   

1.配置standalone將本地tomcat伺服器配置拷貝下來,並運行在standalone指定的目錄下,可以運行為指定連接埠

[html] view plaincopy<plugin>      <groupId>org.codehaus.cargo</groupId>      <artifactId>cargo-maven2-plugin</artifactId>      <version>1.2.4</version>      <configuration>          <container>              <containerId>tomcat7x</containerId>              <home>${env.CATALINA_HOME}</home>          </container>          <configuration>              <type>standalone</type>              <home>${project.build.directory}/target/tomcat7x</home>              <properties>                  <cargo.servlet.port>9234</cargo.servlet.port>              </properties>          </configuration>      </configuration>  </plugin>

執行mvn package cargo:start


2.下載web伺服器並運行

[html] view plaincopy<container>      <containerId>glassfish3x</containerId>      <containerUrl>http://download.java.net/glassfish/3.1.1/release/glassfish-3.1.1.zip</containerUrl>  </container>

 

執行mvn package cargo:start


3.通過existing方式運行

[html] view plaincopy<plugin>      <groupId>org.codehaus.cargo</groupId>      <artifactId>cargo-maven2-plugin</artifactId>      <version>1.2.4</version>      <configuration>          <container>              <containerId>tomcat7x</containerId>              <home>${env.CATALINA_HOME}</home>          </container>          <configuration>              <type>existing</type>              <home>${env.CATALINA_HOME}</home>          </configuration>      </configuration>  </plugin>

不能指定連接埠號碼,它直接運行指定位置的伺服器

執行mvn package cargo:start

4.配置到遠程web伺服器

[html] view plaincopy<plugin>      <groupId>org.codehaus.cargo</groupId>      <artifactId>cargo-maven2-plugin</artifactId>      <version>1.2.4</version>      <configuration>          <container>              <containerId>tomcat7x</containerId>              <type>remote</type>          </container>          <configuration>              <type>runtime</type>              <properties>                  <cargo.hostname>localhost</cargo.hostname>                  <cargo.servlet.port>8080</cargo.servlet.port>                  <cargo.remote.username>tomcat</cargo.remote.username>                  <cargo.remote.password>tomcat</cargo.remote.password>              </properties>          </configuration>      </configuration>  </plugin>

運行mvn package cargo:redeploy,將war配置到localhost的port連接埠

運行mvn cargo:undeploy卸載war


maven 通過cargo配置運行到web伺服器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.