maven插件介绍之tomcat7-maven-plugin
生活随笔
收集整理的這篇文章主要介紹了
maven插件介绍之tomcat7-maven-plugin
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
tomcat7-maven-plugin插件的pom.xml依賴為:
<dependency><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version> </dependency>一:直接執(zhí)行webapp項(xiàng)目 <plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><path>/taobao</path><port>9090</port><uriEncoding>UTF-8</uriEncoding></configuration> </plugin>
運(yùn)行 mvn tomcat7:run
訪問 http://127.0.0.1:9090/taobao 就可以訪問
二:部署項(xiàng)目到tomcat
首先。在conf/tomcat-users.xml 文件中面配置
<role rolename="manager-gui"/> <user username="admin" password="123456" roles="manager,manager-gui"/>兩種方法部署
(1)
直接在pom.xml里面配置插件
<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><path>/taobao</path><url>http://127.0.0.1:8080/manager/text</url><username>admin</username><password>123456</password></configuration> </plugin>(2)
<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><uriEncoding>UTF-8</uriEncoding><url>http://127.0.0.1:8080/manager/text</url><server>tomcat7</server></configuration> </plugin>然后,在settting.xml里面加入 <server><id>tomcat7</id><username>admin</username><password>123456</password> </server>
最后,運(yùn)行 mvn tomcat7:deploy就可以部署
訪問地址為:http://127.0.0.1:8080/taobao
maven技術(shù)交流 扣扣群 ?379165311。群里面會(huì)不定期分享一些maven文章和教程,歡迎大家增加
總結(jié)
以上是生活随笔為你收集整理的maven插件介绍之tomcat7-maven-plugin的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CentOS7下的AIDE***检测配置
- 下一篇: 微软免费软件项目DreamSpark更名