maven+tomcat7插件配置

今天闲来无事,看了看maven+tomcat的相关资料,发现maven做了个简化版的tomcat,各位tomcat粉丝有福音了。

<plugin>
	<groupId>org.apache.tomcat.maven</groupId>
	<artifactId>tomcat7-maven-plugin</artifactId>
	<version>2.0-beta-1</version>
	<configuration>
	<uriEncoding>utf-8</uriEncoding>
	<port>80</port>
	<path>/</path>
	</configuration>
</plugin>

 将上面代码放入pom.xml内,运行tomcat:run就OK,是不是很简单啊,不用下载 tomcat,不用配置tomcat。

注解:如果pom.xml中有servlet-api.jar,jsp-api.jar,el-api.jar这三个包就要去掉哦。tomcat自带了这3个包

猜你喜欢

转载自jishiweili.iteye.com/blog/2082188