maven默认是使用tomcat6跑项目的,这段是让maven用tomcat7去跑
在pom.xml中添加
<build> <!-- we dont want the version to be part of the generated war file name --> <finalname>${project.artifactid}</finalname> <defaultgoal>compile</defaultgoal> <plugins> <plugin> <groupid>org.apache.tomcat.maven</groupid> <artifactid>tomcat7-maven-plugin</artifactid><span style="white-space:pre;"> </span><!--使用tomcat7运行--><span style="white-space:pre;"> </span> <version>2.2</version> <configuration> <port>8082</port><span style="white-space:pre;"> </span><!--运行端口--> <!-- <path>/mgr</path> --> <uriencoding>utf-8</uriencoding> <finalname>mgr</finalname> <path>/kbase</path><span style="white-space:pre;"> </span><!--项目名--> <server>tomcat7</server><span style="white-space:pre;"> </span> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build>
以上这篇maven 修改tomcat运行版本和端口的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!
网友评论