Springboot Jsp 打包无法访问

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/caox_90/article/details/88745360

Jsp项目打包后访问不到页面的问题

需要在build中加入

<resources>
    <resource>
        <directory>src/main/webapp</directory>
        <targetPath>META-INF/resources</targetPath>
        <includes>
            <include>**/**</include>
        </includes>
    </resource>
    <resource>
        <directory>src/main/resources</directory>
        <includes>
            <include>**/**</include>
        </includes>
        <filtering>false</filtering>
    </resource>
    <resource>
        <directory>src/main/java</directory>
        <excludes>
            <exclude>**/*.java</exclude>
        </excludes>
    </resource>
</resources>

另:打包maven插件需使用1.4.2.RELEASE

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>1.4.2.RELEASE</version>
    <configuration>
        <fork>true</fork>     <!--fork :  如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
    </configuration>
</plugin>

猜你喜欢

转载自blog.csdn.net/caox_90/article/details/88745360