2022-11-24 348
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运行版本和端口的实现方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!
原文链接:https://77isp.com/post/16123.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态