国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Tomcat > 正文

spring Boot打包部署到遠程服務器的tomcat中

2024-09-06 19:00:51
字體:
來源:轉載
供稿:網友

前言

Spring Boot項目一般都是內嵌tomcat或者jetty服務器運行,很少用war包部署到外部的服務容器,即使放到linux中,一般也是直接啟動Application類,但是有些時候我們需要部署到外部的服務器,這對于Spring Boot來說卻有點麻煩

下面話不多說了,來一起看看詳細的介紹吧。

環(huán)境聲明:

jdk:1.8

服務器:阿里云,ubuntu 16.04

springBoot:1.5.9.RELEASE

目的

將springBoot 打包到遠程服務器的tomcat中。

pom.xml

<?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>waibao</groupId> <artifactId>project</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <parent>  <groupId>org.springframework.boot</groupId>  <artifactId>spring-boot-starter-parent</artifactId>  <version>1.5.9.RELEASE</version> </parent> <properties>  <java.version>1.8</java.version> </properties> <dependencies>  <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-starter-web</artifactId>  </dependency>    <!-- 移除tomcat的支持,改成編譯時支持 -->  <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-starter-tomcat</artifactId>   <scope>provided</scope>  </dependency>  <dependency>   <groupId>org.mybatis.spring.boot</groupId>   <artifactId>mybatis-spring-boot-starter</artifactId>   <version>1.3.1</version>  </dependency>  <!--非嚴格模式 -->  <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-starter-thymeleaf</artifactId>  </dependency>  <!-- 配置thymeleaf的非嚴格模式,需要該依賴-->  <dependency>   <groupId>net.sourceforge.nekohtml</groupId>   <artifactId>nekohtml</artifactId>   <version>1.9.22</version>  </dependency>  <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-starter-jdbc</artifactId>  </dependency>  <dependency>   <groupId>org.mybatis.spring.boot</groupId>   <artifactId>mybatis-spring-boot-starter</artifactId>   <version>1.3.1</version>  </dependency>  <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-starter-test</artifactId>   <scope>test</scope>  </dependency>  <dependency>   <groupId>mysql</groupId>   <artifactId>mysql-connector-java</artifactId>   <version>6.0.6</version>  </dependency>  <!-- 阿里連接池-->  <dependency>   <groupId>com.alibaba</groupId>   <artifactId>druid</artifactId>   <version>1.1.5</version>  </dependency>  <!-- fastJson -->  <dependency>   <groupId>com.alibaba</groupId>   <artifactId>fastjson</artifactId>   <version>1.2.40</version>  </dependency>  <!-- 熱部署-->  <dependency>   <groupId>org.springframework.boot</groupId>   <artifactId>spring-boot-devtools</artifactId>   <version>1.5.9.RELEASE</version>   <optional>true</optional>   <scope>true</scope>  </dependency> </dependencies> <build>  <finalName>/testweb</finalName>  <plugins>   <plugin>    <groupId>org.apache.maven.plugins</groupId>    <artifactId>maven-war-plugin</artifactId>    <version>2.4</version>    <configuration>     <failOnMissingWebXml>false</failOnMissingWebXml>    </configuration>   </plugin>  </plugins> </build></project>
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 樟树市| 余姚市| 江孜县| 武安市| 黑山县| 晋宁县| 恩平市| 页游| 华蓥市| 昂仁县| 绥阳县| 九寨沟县| 澜沧| 衡南县| 新余市| 定襄县| 武威市| 公安县| 陈巴尔虎旗| 吉林省| 科尔| 遂平县| 图木舒克市| 宁阳县| 拜城县| 松溪县| 类乌齐县| 巴马| 玉树县| 大关县| 屯昌县| 揭阳市| 博爱县| 永新县| 七台河市| 安多县| 如皋市| 新安县| 剑阁县| 台北市| 酒泉市|