Maven 修改tomcat运行版本和端口的实现方法

(编辑:jimmy 日期: 2024/9/21 浏览:2)

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运行版本和端口的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

一句话新闻
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。