eclipse+maven搭建web工程之發布和訪問

來源:互聯網
上載者:User

標籤:技術分享   工程   span   org   name   images   plugin   div   com   

直接,建立一個index.jsp一會訪問它

我們用tomcat7-maven-plugin外掛程式,在maven工程中的pom.xml中如下配置。

 1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 2   <modelVersion>4.0.0</modelVersion> 3   <groupId>com.springinaction.chapter07</groupId> 4   <artifactId>chapter07</artifactId> 5   <version>0.0.1-SNAPSHOT</version> 6   <packaging>war</packaging> 7    8   <build> 9         <!-- 配置外掛程式 -->10         <plugins>11             <plugin>12                 <groupId>org.apache.tomcat.maven</groupId>13                 <artifactId>tomcat7-maven-plugin</artifactId>14                 <configuration>15                     <port>8080</port>16                     <path>/</path>17                     <url>localhost:8080/</url>18                     <username>tomcat</username>19                     <password>tomcat</password>20                 </configuration>21             </plugin>22         </plugins>23     </build>24     25 </project>
View Code

 

第一次啟動並執行話,需要下載點東西,網速不好的話,下載不完,就啟動不成功的,依賴下載完後,應該會如下的:

瀏覽器進行訪問:

接下來可以開發了,這個過程只是簡單的建立單個的war工程,實際項目不是這麼簡單。

 

eclipse+maven搭建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.