springboot打包jar包找不到jsp文件

深藏阁楼爱情的钟 2022-04-17 06:36 708阅读 0赞

打包成jar的时候会找不到jsp文件 只需要 在pom.xml文件添加

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.springframework.boot</groupId>
  5. <artifactId>spring-boot-maven-plugin</artifactId>
  6. </plugin>
  7. <plugin>
  8. <groupId>org.apache.maven.plugins</groupId>
  9. <artifactId>maven-resources-plugin</artifactId>
  10. <configuration>
  11. <encoding>UTF-8</encoding>
  12. <useDefaultDelimiters>true</useDefaultDelimiters>
  13. </configuration>
  14. </plugin>
  15. </plugins>
  16. <resources>
  17. <resource>
  18. <directory>src/main/resources</directory>
  19. <filtering>true</filtering>
  20. </resource>
  21. <resource>
  22. <directory>src/main/webapp</directory>
  23. <!--注意此次必须要放在此目录下才能被访问到 -->
  24. <targetPath>META-INF/resources</targetPath>
  25. <includes>
  26. <include>**/**</include>
  27. </includes>
  28. </resource>
  29. </resources>
  30. <testResources>
  31. <testResource>
  32. <directory>src/test/resources</directory>
  33. <filtering>true</filtering>
  34. </testResource>
  35. </testResources>
  36. </build>

发表评论

表情:
评论列表 (有 0 条评论,708人围观)

还没有评论,来说两句吧...

相关阅读