com.spring4all:swagger-spring-boot-starter:1.7.1.RELEASE导致,项目启动出错

Springboot 启动出错如下:
Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.util.Assert.isInstanceOf(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/function/Supplier;)V
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:294)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:118)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:232)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:213)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
	at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:79)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$starting$0(SpringApplicationRunListeners.java:56)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
	at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:56)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:294)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
	at com.wms.WmsApplication.main(WmsApplication.java:10)

配置文件放入

            com.spring4all

            swagger-spring-boot-starter

            1.7.1.RELEASE

        

查找版本时候在   文件 project  structure  中找到libraries    +   from  maven ,查询

swagger-spring-boot-starter:1.7.1.RELEASE

就会出现很多版本,选择适合自己的,忘记了,我点击了下载,然后又配置了pom.xml文件。所以maven 里面自动下载了,但是在开发项目左边的project 下的External Libraries下边也下载了一个 scom.spring4all:wagger-spring-boot-starter:1.7.1.RELEASE

这样就重复了

只需要把project 下的External Libraries 的 project 下的

scom.spring4all:wagger-spring-boot-starter:1.7.1.RELEASE

删除即可,只需要保留maven中的scom.spring4all:wagger-spring-boot-starter:1.7.1.RELEASE

即可

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/b8d3f666cc.html