引自:SpringBoot項目如何進行打包部署php
springboot的打包方式有不少種。有打成war的,有打成jar的,也有直接提交到github,經過jekins進行打包部署的。這裏主要介紹如何打成jar進行部署。不推薦用war,由於springboot適合先後端分離,打成jar進行部署更合適。
首先須要在application.properties當中配置端口html
server.port=8080
# http://localhost:8088/swagger-ui.html
marven的配置文件java
<?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"> <modelVersion>4.0.0</modelVersion> <groupId>com.weixin</groupId> <artifactId>smallsystem</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>smallsystem</name> <description>smallsystem</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test