Maven 修改tomcat運(yùn)行版本和端口的實(shí)現(xiàn)方法
maven默認(rèn)是使用tomcat6跑項(xiàng)目的,這段是讓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運(yùn)行--><span style="white-space:pre;"> </span> <version>2.2</version> <configuration> <port>8082</port><span style="white-space:pre;"> </span><!--運(yùn)行端口--> <!-- <path>/mgr</path> --> <uriEncoding>UTF-8</uriEncoding> <finalName>mgr</finalName> <path>/KBase</path><span style="white-space:pre;"> </span><!--項(xiàng)目名--> <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運(yùn)行版本和端口的實(shí)現(xiàn)方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
tomcat使用問題之安裝后無法訪問localhost:8080解決
當(dāng)Tomcat無法訪問localhost:8080時(shí),可能是由于未啟動(dòng)、環(huán)境變量未配置、端口號占用或版本問題,這篇文章主要介紹了tomcat使用問題之安裝后無法訪問localhost:8080解決的相關(guān)資料,需要的朋友可以參考下2024-10-10詳解從源碼分析tomcat如何調(diào)用Servlet的初始化
這篇文章主要介紹了詳解從源碼分析tomcat如何調(diào)用Servlet的初始化,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-04-04Idea中tomcat啟動(dòng)源碼調(diào)試進(jìn)入到tomcat內(nèi)部進(jìn)行調(diào)試的方法
這篇文章主要介紹了Idea中tomcat啟動(dòng)源碼調(diào)試進(jìn)入到tomcat內(nèi)部進(jìn)行調(diào)試的方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-09-09解決Tomcat啟動(dòng)失敗:嚴(yán)重?[main]?org.apache.catalina.util.LifecycleB
這篇文章主要介紹了解決Tomcat啟動(dòng)失敗:嚴(yán)重?[main]org.apache.catalina.util.LifecycleBase.handleSubClassException?初始化組件失敗問題的方法,希望可以幫助到你2023-03-03Tomcat啟動(dòng)報(bào)錯(cuò):嚴(yán)重: Unable to process Jar&nbs
本文主要介紹了Tomcat啟動(dòng)報(bào)錯(cuò):嚴(yán)重: Unable to process Jar entry [module-info.class],文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-06-06