1.原因
因為springboot-maven-plugin打包的第一級目錄為Boot-INF,無法引用
2.解決
不能使用springboot項目自帶的打包插件進行打包
1
2
3
4
5
6
7
8
|
< build > < plugins > < plugin > < groupId >org.springframework.boot</ groupId > < artifactId >spring-boot-maven-plugin</ artifactId > </ plugin > </ plugins > </ build > |
使用傳統項目的maven打包
1
2
3
4
5
6
7
8
9
10
11
12
|
< build > < plugins > < plugin > < groupId >org.apache.maven.plugins</ groupId > < artifactId >maven-compiler-plugin</ artifactId > < configuration > < source >1.8</ source > <!--指明源碼用的Jdk版本--> < target >1.8</ target > <!--指明打包后的Jdk版本--> </ configuration > </ plugin > </ plugins > </ build > |
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。
原文鏈接:https://www.cnblogs.com/taohaijun/p/10578998.html