1、maven依赖
maven打包插件
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.2.RELEASE </version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<useDefaultDelimiters>true</useDefaultDelimiters>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/webapp/</directory>
<targetPath>META-INF/resources</targetPath>
</resource>
</resources>
2、注意事项:
1)springboot 打包插件的版本必须为1.4.2.RELEASE,只有这个版本支持jsp,高版本不行
2)webapp下所有的前端资源必须打包到jar包的META-INF/resources的目录下,否则无法识别