springfox-boot-starter 3.0.0 报错 PluginRegistry 冲突

435 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。

springfox-boot-starter 3.0.0 报错 PluginRegistry 冲突

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;)Ljava/util/Optional; but it does not exist. Its class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:

    jar:file:/D:/maven/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class

It was loaded from the following location:

    file:/D:/maven/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry

Disconnected from the target VM, address: '127.0.0.1:56473', transport: 'socket'

Process finished with exit code 1

解决方案:

        <!-- 修复 springfox 依赖冲突问题 -->
	<dependency>
		<groupId>org.springframework.plugin</groupId>
		<artifactId>spring-plugin-core</artifactId>
		<version>2.0.0.RELEASE</version>
	</dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>3.0.0</version>
        </dependency>

参考: github.com/springfox/s…