My project is working fine with swagger2 version 2.7.0.not spring boot(spring mvc only) I am going to upgrade it 3.0.0 but it's giving plugin errors.
java.lang.nosuchMethodError:org.springframework.plugin.core.pluginRegistry.getPluginFor(Ljava/lang/Object;)Ljava/util/Optional;
My config as below:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
Update: As mentioned in https://github.com/springfox/springfox
Step 2 : Add @EnableOpenApi for open API (and @EnableSwagger2WebMvc or @EnableSwagger2WebFlux for older versions)
I added @EnableSwagger2WebMvc in class ,Then it's asking dependency of springfox-swagger2,
as this coming from :
http://springfox.github.io/springfox/javadoc/snapshot/springfox/documentation/swagger2/annotations/EnableSwagger2WebMvc.html
which is part of springfox-swagger2 dependency
Hence I am confused what to do..
can you please help cleaner approach with steps .
If I don't use @EnableSwagger2WebMvc/EnableSwagger2
Swagger is not getting loaded
Not sure if you are using Spring Boot, or regular Spring flavor, but have you followed the migration instructions posted here?
https://github.com/springfox/springfox
springfox-swagger2
@EnableSwagger2...
annotationsspringfox-boot-starter
(Spring boot) or springfox-oas
(Spring MVC) dependencyguava
WebMvc
but you don't use the @EnableWebMvc
annotation yet, add this annotation (Spring boot).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.