使用maven的tomcat:run進行web項目熱部署,maventomcat

來源:互聯網
上載者:User

使用maven的tomcat:run進行web項目熱部署,maventomcat

最近又重新看了一下maven的東西,其實主要是因為去瞭解Jenkins,後期也許會補充jenkins的博文。

怎麼在eclipse裡面建立maven web工程,這邊就不介紹了,參見:http://blog.csdn.net/enson16855/article/details/19702477 ,一般情況下我們都是講web工程發不到外部的tomcat環境下開發調試什麼的,本人最近覺得有點繁瑣。

1、首先來看一下maven tomcat外掛程式:

<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><port>8080</port><path>/dubbo-admin</path><uriEncoding>UTF-8</uriEncoding><finalName>dubbo-admin</finalName><server>tomcat7</server></configuration></plugin>
2、配置jsp,servlet依賴什麼的..

<dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId><version>2.5</version><scope>provided</scope></dependency><dependency><groupId>javax.servlet.jsp</groupId><artifactId>jsp-api</artifactId><version>2.2</version><scope>provided</scope></dependency><dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><version>1.2</version></dependency><dependency><groupId>jsptags</groupId><artifactId>pager-taglib</artifactId><version>2.0</version><scope>provided</scope></dependency>
一定需要以上的依賴,否則項目建立jsp檔案都會有錯誤出現....

3、接下來就是發布的事情了。。



建立一個maven build如下:


4、點擊apply,再點擊run即可:


表示啟動成功了...是不是很方便???


著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.