Luc*_*caA 5 java rest dropwizard swagger
我尝试使用dropwizard框架0.9.1配置swagger.
在我的pom.xml中:
Run Code Online (Sandbox Code Playgroud)<dependency> <groupId>io.swagger</groupId> <artifactId>swagger-jersey2-jaxrs</artifactId> <version>1.5.4</version> <scope>compile</scope> <exclusions> <exclusion> <groupId>com.sun.jersey</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency>但是
java.lang.NoClassDefFoundError: jersey/repackaged/com/google/common/collect/ImmutableMap抛出了.怎么了?
解决方案是在依赖项部分中设置正确的排除项:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.5.4</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
</exclusion>
<exclusion>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
</exclusion>
</exclusions>
</dependency>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
275 次 |
| 最近记录: |