spring boot打jar包打不开网页(如图)
pom.xml文件如下(主要是build标签的resources,依赖参考别人说的就行)
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0
</modelVersion>
<parent>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-starter-parent
</artifactId>
<version>2.1.3.RELEASE
</version>
<relativePath/>
</parent>
<groupId>com.baizhi
</groupId>
<artifactId>tour-boot
</artifactId>
<version>0.0.1-SNAPSHOT
</version>
<packaging>war
</packaging>
<name>tour-boot
</name>
<description>Demo project for Spring Boot
</description>
<properties>
<java.version>1.8
</java.version>
<druid-version>1.0.16
</druid-version>
<spring-version>5.2.5.RELEASE
</spring-version>
<mybatis-spring-version>1.3.0
</mybatis-spring-version>
<log4j.version>1.2.17
</log4j.version>
<slf4j.version>1.7.25
</slf4j.version>
<jackson-version>2.9.8
</jackson-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-starter-tomcat
</artifactId>
<scope>provided
</scope>
</dependency>
<dependency>
<groupId>jstl
</groupId>
<artifactId>jstl
</artifactId>
<version>1.2
</version>
</dependency>
<dependency>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-starter-test
</artifactId>
<scope>test
</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage
</groupId>
<artifactId>junit-vintage-engine
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet
</groupId>
<artifactId>javax.servlet-api
</artifactId>
<version>3.1.0
</version>
</dependency>
<dependency>
<groupId>jstl
</groupId>
<artifactId>jstl
</artifactId>
<version>1.2
</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed
</groupId>
<artifactId>tomcat-embed-jasper
</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot
</groupId>
<artifactId>mybatis-spring-boot-starter
</artifactId>
<version>1.3.3
</version>
</dependency>
<dependency>
<groupId>com.alibaba
</groupId>
<artifactId>druid
</artifactId>
<version>${druid-version}
</version>
<scope>compile
</scope>
</dependency>
<dependency>
<groupId>com.oracle
</groupId>
<artifactId>ojdbc6
</artifactId>
<version>12.1.0.1-atlassian-hosted
</version>
</dependency>
<dependency>
<groupId>org.projectlombok
</groupId>
<artifactId>lombok
</artifactId>
<version>1.18.12
</version>
<scope>provided
</scope>
</dependency>
<dependency>
<groupId>commons-codec
</groupId>
<artifactId>commons-codec
</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-starter-aop
</artifactId>
</dependency>
<dependency>
<groupId>org.testng
</groupId>
<artifactId>testng
</artifactId>
<version>7.3.0
</version>
<scope>test
</scope>
</dependency>
</dependencies>
<build>
<finalName>Tour
</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-maven-plugin
</artifactId>
<version>1.4.2.RELEASE
</version>
<configuration>
<mainClass>com.baizhi.TourBootApplication
</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins
</groupId>
<artifactId>maven-compiler-plugin
</artifactId>
<configuration>
<fork>true
</fork>
<source>1.6
</source>
<target>1.6
</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/webapp
</directory>
<targetPath>META-INF/resources
</targetPath>
<includes>
<include>**/**
</include>
</includes>
</resource>
<resource>
<directory>src/main/java
</directory>
<includes>
<include>**/*.yml
</include>
<include>**/*.properties
</include>
<include>**/*.xml
</include>
</includes>
<filtering>false
</filtering>
</resource>
<resource>
<directory>src/main/resources
</directory>
<includes>
<include>**/*.yml
</include>
<include>**/*.properties
</include>
<include>**/*.xml
</include>
</includes>
<filtering>false
</filtering>
</resource>
</resources>
</build>
</project>