这个
application.properties 文件 spring.mvc.pathmatch.matching-strategy = Ant 路径匹配器
不适用于
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-boot-starter -->
<!-- <dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency> -->
在 pom.xml 文件中
但确实适用于此:
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.7.4</version>
</dependency>
在 pom.xml 文件中。
如何设置application.properties 文件属性 spring.mvc.pathmatch.matching-strategy = ? 这样两个依赖项就可以在同一个应用程序中使用而不会出现错误:
> java.lang.IllegalStateException:无法加载 ApplicationContext 由以下原因引起:org.springframework.context.ApplicationContextException:无法启动 bean 'documentationPluginsBootstrapper';嵌套异常是 java.lang.NullPointerException:无法调用“org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()”因为“this.condition”为空 Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()"因为 "this.condition"为 null
在 maven clean install 命令中。
最佳答案
这是一个开放的issue对于 sprinfox
项目,它也记录在 spring-boot
的发行说明中 2.6 Release Notes .
您目前可以做的是尝试 workaround1或 workaround2在上述问题中提供。
关于java - spring mvc 路径匹配匹配策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73955946/