springboot项目打war包

  1. spring官方教程地址(包含打war包和打jar包的):https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging
  2. 我使用的项目管理工具是maven,如果你用的gradle,文档中也是有的
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    	<!-- ... -->
    	<packaging>war</packaging>
    	<!-- ... -->
    	<dependencies>
    		<dependency>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-starter-web</artifactId>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-starter-tomcat</artifactId>
    			<scope>provided</scope>
    		</dependency>
    		<!-- ... -->
    	</dependencies>
    </project>
    

      

  3. 打包操作

  4. spring4All社区的打包教程地址,中文的,而且详细易懂
    地址:http://www.spring4all.com/article/537

猜你喜欢

转载自www.cnblogs.com/coderjinjian/p/9707476.html