背景:公司项目,打包后无法访问JSP页面
一、打包后的jar包里没有jsp:
修改pom.xml,在其中加上如下配置
<resource>
<directory>src/main/webapp</directory>
<!-- webapp下的内容,必须放在该路径下 -->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
二、jar包里有jsp,但还是访问不到:
修改pom.xml,加入如下配置:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- 必须使用1.4.2版本,才能使打包后的项目访问jsp页面 -->
<version>1.4.2.RELEASE</version>
</plugin>