springboot 将jsp项目打成jar包 出现404错误

时间:2025-01-20 07:13:44
  • <build>
  • <plugins>
  • <!-- 一定要注意mvn的插件一定是1.4.,否则jsp访问不到,如下图所示 -->
  • <plugin>
  • <groupId></groupId>
  • <artifactId>spring-boot-maven-plugin</artifactId>
  • <version>1.4.</version>
  • </plugin>
  • </plugins>
  • <resources>
  • <!-- 打包时将jsp文件拷贝到META-INF目录下-->
  • <resource>
  • <!-- 指定resources插件处理哪个目录下的资源文件 -->
  • <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>
  • </resources>
  • </build>