1、tomcat下载并解压
https://tomcat.apache.org/download-90.cgi
2、打包项目
相关pom依赖
<build>
<finalName>bomc-itsm</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.7.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
使用maven中的package打包,并将war包放入到tomcat的webapps文件夹
3、修改配置文件
打开tomcat目录下的conf目录中的server.xml文件
在元素末找元素,在元素末尾增加:
<Context path="/项目名称" docBase="项目路径" reloadable="true"/>
运行tomcat
访问http://localhost:8080/项目名称 就可以访问项目了