springboot接入hateoas与swagger2问题记录

环境:springboot 2.2.1.RELEASE,swagger 2.9.2

问题记录

启动服务报错如下

Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 3 were found:
	- relProviderPluginRegistry: defined by method 'relProviderPluginRegistry' in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]
	- linkDiscovererRegistry: defined in null
	- entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry' in class path resource [org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]

问题出在了hateoas与swagger2中的spring-plugin出现了冲突,swagger2使用版本为:1.2.0.RELEASE,hateoas使用版本为:2.0.0.RELEASE,排除掉swagger2中的plugin

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger2</artifactId>
  <version>${springfox-swagger2.version}</version>
  <exclusions>
    <exclusion>
      <groupId>org.springframework.plugin</groupId>
      <artifactId>spring-plugin-core</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger-ui</artifactId>
  <version>${springfox-swagger-ui.version}</version>
</dependency>

结果出现了新的异常,异常是因为plugin版本的问题导致某些方法找不到了

"D:\Program Files\Java\jdk1.8.0_131\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60907,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=60906 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:D:\Applications\ideaIU-2018.1.3.win\lib\rt\debugger-agent.jar=file:/C:/Users/Gallant/AppData/Local/Temp/capture2.props -Dfile.encoding=UTF-8 -classpath "D:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\deploy.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\localedata.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunec.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\javaws.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jce.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jfr.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jfxswt.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jsse.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\management-agent.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\plugin.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\resources.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\rt.jar;D:\git\private\account-service\target\classes;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter\2.2.1.RELEASE\spring-boot-starter-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot\2.2.1.RELEASE\spring-boot-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-context\5.2.1.RELEASE\spring-context-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-autoconfigure\2.2.1.RELEASE\spring-boot-autoconfigure-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-logging\2.2.1.RELEASE\spring-boot-starter-logging-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-core\5.2.1.RELEASE\spring-core-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-jcl\5.2.1.RELEASE\spring-jcl-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\net\minidev\json-smart\2.3\json-smart-2.3.jar;D:\Applications\apache-maven-3.5.0\conf\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\net\bytebuddy\byte-buddy\1.10.2\byte-buddy-1.10.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-jdbc\2.2.1.RELEASE\spring-boot-starter-jdbc-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\zaxxer\HikariCP\3.4.1\HikariCP-3.4.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-jdbc\5.2.1.RELEASE\spring-jdbc-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-tx\5.2.1.RELEASE\spring-tx-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\mybatis\3.4.4\mybatis-3.4.4.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\mybatis-spring\1.3.1\mybatis-spring-1.3.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\1.3.2\mybatis-spring-boot-starter-1.3.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\1.3.2\mybatis-spring-boot-autoconfigure-1.3.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\mysql\mysql-connector-java\8.0.18\mysql-connector-java-8.0.18.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\projectlombok\lombok\1.18.10\lombok-1.18.10.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-web\2.2.1.RELEASE\spring-boot-starter-web-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-json\2.2.1.RELEASE\spring-boot-starter-json-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\core\jackson-databind\2.10.0\jackson-databind-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\core\jackson-core\2.10.0\jackson-core-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.0\jackson-datatype-jdk8-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.0\jackson-datatype-jsr310-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.0\jackson-module-parameter-names-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-validation\2.2.1.RELEASE\spring-boot-starter-validation-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\validation\jakarta.validation-api\2.0.1\jakarta.validation-api-2.0.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-web\5.2.1.RELEASE\spring-web-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-webmvc\5.2.1.RELEASE\spring-webmvc-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-expression\5.2.1.RELEASE\spring-expression-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-aop\2.2.1.RELEASE\spring-boot-starter-aop-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-aop\5.2.1.RELEASE\spring-aop-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-jetty\2.2.1.RELEASE\spring-boot-starter-jetty-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\servlet\jakarta.servlet-api\4.0.3\jakarta.servlet-api-4.0.3.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\websocket\jakarta.websocket-api\1.1.2\jakarta.websocket-api-1.1.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-servlets\9.4.22.v20191022\jetty-servlets-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-continuation\9.4.22.v20191022\jetty-continuation-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-http\9.4.22.v20191022\jetty-http-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-util\9.4.22.v20191022\jetty-util-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-io\9.4.22.v20191022\jetty-io-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-webapp\9.4.22.v20191022\jetty-webapp-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-xml\9.4.22.v20191022\jetty-xml-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-servlet\9.4.22.v20191022\jetty-servlet-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-security\9.4.22.v20191022\jetty-security-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-server\9.4.22.v20191022\jetty-server-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-server\9.4.22.v20191022\websocket-server-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-common\9.4.22.v20191022\websocket-common-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-api\9.4.22.v20191022\websocket-api-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-client\9.4.22.v20191022\websocket-client-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-client\9.4.22.v20191022\jetty-client-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-servlet\9.4.22.v20191022\websocket-servlet-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\javax-websocket-server-impl\9.4.22.v20191022\javax-websocket-server-impl-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-annotations\9.4.22.v20191022\jetty-annotations-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-plus\9.4.22.v20191022\jetty-plus-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm\7.1\asm-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm-commons\7.1\asm-commons-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm-tree\7.1\asm-tree-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm-analysis\7.1\asm-analysis-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\javax-websocket-client-impl\9.4.22.v20191022\javax-websocket-client-impl-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mortbay\jasper\apache-el\8.5.40\apache-el-8.5.40.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-log4j2\2.2.1.RELEASE\spring-boot-starter-log4j2-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-slf4j-impl\2.12.1\log4j-slf4j-impl-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-api\2.12.1\log4j-api-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-core\2.12.1\log4j-core-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-jul\2.12.1\log4j-jul-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\slf4j\jul-to-slf4j\1.7.29\jul-to-slf4j-1.7.29.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\lmax\disruptor\3.4.2\disruptor-3.4.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\javax\servlet\javax.servlet-api\4.0.1\javax.servlet-api-4.0.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\guava\guava\28.0-jre\guava-28.0-jre.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\checkerframework\checker-qual\2.8.1\checker-qual-2.8.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\errorprone\error_prone_annotations\2.3.2\error_prone_annotations-2.3.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\codehaus\mojo\animal-sniffer-annotations\1.17\animal-sniffer-annotations-1.17.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\data\spring-data-commons\2.2.1.RELEASE\spring-data-commons-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-beans\5.2.1.RELEASE\spring-beans-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\slf4j\slf4j-api\1.7.29\slf4j-api-1.7.29.jar;D:\Applications\apache-maven-3.5.0\conf\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\alibaba\fastjson\1.2.44\fastjson-1.2.44.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-hateoas\2.2.1.RELEASE\spring-boot-starter-hateoas-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\hateoas\spring-hateoas\1.0.1.RELEASE\spring-hateoas-1.0.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\plugin\spring-plugin-core\2.0.0.RELEASE\spring-plugin-core-2.0.0.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\atteo\evo-inflector\1.2.2\evo-inflector-1.2.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-swagger2\2.9.2\springfox-swagger2-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\swagger\swagger-annotations\1.5.20\swagger-annotations-1.5.20.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\swagger\swagger-models\1.5.20\swagger-models-1.5.20.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.0\jackson-annotations-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-spi\2.9.2\springfox-spi-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-core\2.9.2\springfox-core-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-schema\2.9.2\springfox-schema-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-swagger-common\2.9.2\springfox-swagger-common-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-spring-web\2.9.2\springfox-spring-web-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\plugin\spring-plugin-metadata\1.2.0.RELEASE\spring-plugin-metadata-1.2.0.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mapstruct\mapstruct\1.2.0.Final\mapstruct-1.2.0.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-swagger-ui\2.9.2\springfox-swagger-ui-2.9.2.jar;D:\Applications\ideaIU-2018.1.3.win\lib\idea_rt.jar" org.gallant.account.Application
Connected to the target VM, address: '127.0.0.1:60907', transport: 'socket'
2019-12-26 19:37:36,075 main WARN No Root logger was configured, creating default ERROR-level Root logger with Console appender
2019-12-26 19:37:36,554 main WARN No Root logger was configured, creating default ERROR-level Root logger with Console appender

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.1.RELEASE)

19:37:36.714 [main] INFO  org.gallant.account.Application - Starting Application on LAPTOP-3C5Q1073 with PID 1352 (D:\git\private\account-service\target\classes started by Gallant in D:\git\private\account-service)
19:37:36.731 [main] DEBUG org.gallant.account.Application - Running with Spring Boot v2.2.1.RELEASE, Spring v5.2.1.RELEASE
19:37:36.732 [main] INFO  org.gallant.account.Application - No active profile set, falling back to default profiles: default
19:37:41.027 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - 

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

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)

The following method did not exist:

    org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;

The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:

    jar:file:/D:/Applications/apache-maven-3.5.0/conf/repository/org/springframework/plugin/spring-plugin-core/2.0.0.RELEASE/spring-plugin-core-2.0.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class

It was loaded from the following location:

    file:/D:/Applications/apache-maven-3.5.0/conf/repository/org/springframework/plugin/spring-plugin-core/2.0.0.RELEASE/spring-plugin-core-2.0.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:60907', transport: 'socket'

Process finished with exit code 1

那么反过来尝试排除hateoas中的spring-plugin保留swagger2中的spring-plugin结果又出现了之前的报错,而且多出了很多

"D:\Program Files\Java\jdk1.8.0_131\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:61096,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=61095 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:D:\Applications\ideaIU-2018.1.3.win\lib\rt\debugger-agent.jar=file:/C:/Users/Gallant/AppData/Local/Temp/capture2.props -Dfile.encoding=UTF-8 -classpath "D:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\deploy.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\localedata.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunec.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\javaws.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jce.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jfr.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jfxswt.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jsse.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\management-agent.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\plugin.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\resources.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\rt.jar;D:\git\private\account-service\target\classes;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter\2.2.1.RELEASE\spring-boot-starter-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot\2.2.1.RELEASE\spring-boot-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-context\5.2.1.RELEASE\spring-context-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-autoconfigure\2.2.1.RELEASE\spring-boot-autoconfigure-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-logging\2.2.1.RELEASE\spring-boot-starter-logging-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-core\5.2.1.RELEASE\spring-core-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-jcl\5.2.1.RELEASE\spring-jcl-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\net\minidev\json-smart\2.3\json-smart-2.3.jar;D:\Applications\apache-maven-3.5.0\conf\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\net\bytebuddy\byte-buddy\1.10.2\byte-buddy-1.10.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-jdbc\2.2.1.RELEASE\spring-boot-starter-jdbc-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\zaxxer\HikariCP\3.4.1\HikariCP-3.4.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-jdbc\5.2.1.RELEASE\spring-jdbc-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-tx\5.2.1.RELEASE\spring-tx-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\mybatis\3.4.4\mybatis-3.4.4.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\mybatis-spring\1.3.1\mybatis-spring-1.3.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\1.3.2\mybatis-spring-boot-starter-1.3.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\1.3.2\mybatis-spring-boot-autoconfigure-1.3.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\mysql\mysql-connector-java\8.0.18\mysql-connector-java-8.0.18.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\projectlombok\lombok\1.18.10\lombok-1.18.10.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-web\2.2.1.RELEASE\spring-boot-starter-web-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-json\2.2.1.RELEASE\spring-boot-starter-json-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\core\jackson-databind\2.10.0\jackson-databind-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\core\jackson-core\2.10.0\jackson-core-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.0\jackson-datatype-jdk8-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.0\jackson-datatype-jsr310-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.0\jackson-module-parameter-names-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-validation\2.2.1.RELEASE\spring-boot-starter-validation-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\validation\jakarta.validation-api\2.0.1\jakarta.validation-api-2.0.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-web\5.2.1.RELEASE\spring-web-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-webmvc\5.2.1.RELEASE\spring-webmvc-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-expression\5.2.1.RELEASE\spring-expression-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-aop\2.2.1.RELEASE\spring-boot-starter-aop-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-aop\5.2.1.RELEASE\spring-aop-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-jetty\2.2.1.RELEASE\spring-boot-starter-jetty-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\servlet\jakarta.servlet-api\4.0.3\jakarta.servlet-api-4.0.3.jar;D:\Applications\apache-maven-3.5.0\conf\repository\jakarta\websocket\jakarta.websocket-api\1.1.2\jakarta.websocket-api-1.1.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-servlets\9.4.22.v20191022\jetty-servlets-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-continuation\9.4.22.v20191022\jetty-continuation-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-http\9.4.22.v20191022\jetty-http-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-util\9.4.22.v20191022\jetty-util-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-io\9.4.22.v20191022\jetty-io-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-webapp\9.4.22.v20191022\jetty-webapp-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-xml\9.4.22.v20191022\jetty-xml-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-servlet\9.4.22.v20191022\jetty-servlet-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-security\9.4.22.v20191022\jetty-security-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-server\9.4.22.v20191022\jetty-server-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-server\9.4.22.v20191022\websocket-server-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-common\9.4.22.v20191022\websocket-common-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-api\9.4.22.v20191022\websocket-api-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-client\9.4.22.v20191022\websocket-client-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-client\9.4.22.v20191022\jetty-client-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\websocket-servlet\9.4.22.v20191022\websocket-servlet-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\javax-websocket-server-impl\9.4.22.v20191022\javax-websocket-server-impl-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-annotations\9.4.22.v20191022\jetty-annotations-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\jetty-plus\9.4.22.v20191022\jetty-plus-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm\7.1\asm-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm-commons\7.1\asm-commons-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm-tree\7.1\asm-tree-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\ow2\asm\asm-analysis\7.1\asm-analysis-7.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\eclipse\jetty\websocket\javax-websocket-client-impl\9.4.22.v20191022\javax-websocket-client-impl-9.4.22.v20191022.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mortbay\jasper\apache-el\8.5.40\apache-el-8.5.40.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-log4j2\2.2.1.RELEASE\spring-boot-starter-log4j2-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-slf4j-impl\2.12.1\log4j-slf4j-impl-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-api\2.12.1\log4j-api-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-core\2.12.1\log4j-core-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\logging\log4j\log4j-jul\2.12.1\log4j-jul-2.12.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\slf4j\jul-to-slf4j\1.7.29\jul-to-slf4j-1.7.29.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\lmax\disruptor\3.4.2\disruptor-3.4.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\javax\servlet\javax.servlet-api\4.0.1\javax.servlet-api-4.0.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\guava\guava\28.0-jre\guava-28.0-jre.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\checkerframework\checker-qual\2.8.1\checker-qual-2.8.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\errorprone\error_prone_annotations\2.3.2\error_prone_annotations-2.3.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\codehaus\mojo\animal-sniffer-annotations\1.17\animal-sniffer-annotations-1.17.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\data\spring-data-commons\2.2.1.RELEASE\spring-data-commons-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\spring-beans\5.2.1.RELEASE\spring-beans-5.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\slf4j\slf4j-api\1.7.29\slf4j-api-1.7.29.jar;D:\Applications\apache-maven-3.5.0\conf\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\alibaba\fastjson\1.2.44\fastjson-1.2.44.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\boot\spring-boot-starter-hateoas\2.2.1.RELEASE\spring-boot-starter-hateoas-2.2.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\hateoas\spring-hateoas\1.0.1.RELEASE\spring-hateoas-1.0.1.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\atteo\evo-inflector\1.2.2\evo-inflector-1.2.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-swagger2\2.9.2\springfox-swagger2-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\swagger\swagger-annotations\1.5.20\swagger-annotations-1.5.20.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\swagger\swagger-models\1.5.20\swagger-models-1.5.20.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.0\jackson-annotations-2.10.0.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-spi\2.9.2\springfox-spi-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-core\2.9.2\springfox-core-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-schema\2.9.2\springfox-schema-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-swagger-common\2.9.2\springfox-swagger-common-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-spring-web\2.9.2\springfox-spring-web-2.9.2.jar;D:\Applications\apache-maven-3.5.0\conf\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\plugin\spring-plugin-core\1.2.0.RELEASE\spring-plugin-core-1.2.0.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\springframework\plugin\spring-plugin-metadata\1.2.0.RELEASE\spring-plugin-metadata-1.2.0.RELEASE.jar;D:\Applications\apache-maven-3.5.0\conf\repository\org\mapstruct\mapstruct\1.2.0.Final\mapstruct-1.2.0.Final.jar;D:\Applications\apache-maven-3.5.0\conf\repository\io\springfox\springfox-swagger-ui\2.9.2\springfox-swagger-ui-2.9.2.jar;D:\Applications\ideaIU-2018.1.3.win\lib\idea_rt.jar" org.gallant.account.Application
Connected to the target VM, address: '127.0.0.1:61096', transport: 'socket'
2019-12-26 19:47:51,326 main WARN No Root logger was configured, creating default ERROR-level Root logger with Console appender
2019-12-26 19:47:51,803 main WARN No Root logger was configured, creating default ERROR-level Root logger with Console appender

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.1.RELEASE)

19:47:51.949 [main] INFO  org.gallant.account.Application - Starting Application on LAPTOP-3C5Q1073 with PID 232 (D:\git\private\account-service\target\classes started by Gallant in D:\git\private\account-service)
19:47:51.964 [main] DEBUG org.gallant.account.Application - Running with Spring Boot v2.2.1.RELEASE, Spring v5.2.1.RELEASE
19:47:51.965 [main] INFO  org.gallant.account.Application - No active profile set, falling back to default profiles: default
19:47:55.889 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - 

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

Description:

Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 17 were found:
	- modelBuilderPluginRegistry: defined in null
	- modelPropertyBuilderPluginRegistry: defined in null
	- typeNameProviderPluginRegistry: defined in null
	- syntheticModelProviderPluginRegistry: defined in null
	- documentationPluginRegistry: defined in null
	- apiListingBuilderPluginRegistry: defined in null
	- operationBuilderPluginRegistry: defined in null
	- parameterBuilderPluginRegistry: defined in null
	- expandedParameterBuilderPluginRegistry: defined in null
	- resourceGroupingStrategyRegistry: defined in null
	- operationModelsProviderPluginRegistry: defined in null
	- defaultsProviderPluginRegistry: defined in null
	- pathDecoratorRegistry: defined in null
	- apiListingScannerPluginRegistry: defined in null
	- relProviderPluginRegistry: defined by method 'relProviderPluginRegistry' in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]
	- linkDiscovererRegistry: defined in null
	- entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry' in class path resource [org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]


Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

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

Process finished with exit code 1

总结

目前来说hateoas与swagger确实不能兼容。该问题在spring-hateoas社区中也有讨论:https://github.com/spring-projects/spring-hateoas/issues/1094,spring-hateoas不想在项目中引入swagger,因为swagger不能为hateoas项目做任何事情。
swagger:减轻了后端api文档的维护成本
HATEOAS:使客户端与服务端进一步的解耦,例如:客户端根据HATEOAS提供的rel获取链接,服务端可以在客户端无任何感知的情况下修改rel,也就是url路由,像极了修改指针操作。并且提供了一些其他帮助链接信息可以引导客户端发现更多服务端支持的操作。
相比而言目前个人认为HATEOAS相对于swagger而言更为重要。最后放弃了接入swagger

发布了81 篇原创文章 · 获赞 85 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/u010597819/article/details/103754652