現象:springboot項目集成jsp,本地用idea運行,能正常訪問jsp頁面,達成jar之后用 java -jar xxx.jar 執行,同樣的
路徑訪問會報404找不到頁面
問題原因:pom中springboot 的maven打包插件沒有指定正確的版本,需要指定版本為 1.4.2.RELEASE (暫時沒想明白是咋回事)
解決方案:pom中標紅代碼不可少
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.2.RELEASE</version>
<configuration>
<mainClass>webapp.ApiApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
文末小福利免費視頻資源網站(搜索猴):www.sousuohou.com