具体报错:
***************************
APPLICATION FAILED TO START
***************************
Description:
Invalid mapping pattern detected: /**/*.css
^
No more pattern data allowed after {*...} or ** pattern element
Action:
Fix this pattern in your application or switch to the legacy parser implementation with `spring.mvc.pathpattern.matching-strategy=ant_path_matcher`.
Process finished with exit code 0
原因:
错误是路径通配问题,查找发现是spring升级到5.3之后路径通配发生了变化,官方给出的解释是“In Spring MVC, the path was previously analyzed by AntPathMatcher, but it was changed to use PathPatternParser introduced in WebFlux from Spring 5.3.0.”。
解决:
具体解决是把/**/*.css 改为 /*/*.css,项目中可能涉及多个文件,都要改。