英文:
NoClassDefFoundError occurs when using the swagger2Markup
问题
**swagger2Markup maven**
```xml
<dependency>
<groupId>io.github.swagger2markup</groupId>
<artifactId>swagger2markup</artifactId>
<version>1.3.1</version>
</dependency>
测试方法
当我运行这个方法时,出现了错误
@Test
public void generateAsciiDocs() throws Exception {
// 输出Ascii格式
Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
.withMarkupLanguage(MarkupLanguage.ASCIIDOC)
.withOutputLanguage(Language.ZH)
.withPathsGroupedBy(GroupBy.TAGS)
.withGeneratedExamples()
.withoutInlineSchema()
.build();
Swagger2MarkupConverter.from(new URL("http://localhost:8088/v2/api-docs?group=api"))
.withConfig(config)
.build()
.toFolder(Paths.get("src/docs/asciidoc/generated/all"));
}
稍后运行
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/BeanIntrospector
什么是 NoClassDefFoundError?
<details>
<summary>英文:</summary>
**swagger2Markup maven**
<dependency>
<groupId>io.github.swagger2markup</groupId>
<artifactId>swagger2markup</artifactId>
<version>1.3.1</version>
</dependency>
**test method**
When I run this method, it goes wrong
@Test
public void generateAsciiDocs() throws Exception {
// 输出Ascii格式
Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
.withMarkupLanguage(MarkupLanguage.ASCIIDOC)
.withOutputLanguage(Language.ZH)
.withPathsGroupedBy(GroupBy.TAGS)
.withGeneratedExamples()
.withoutInlineSchema()
.build();
Swagger2MarkupConverter.from(new URL("http://localhost:8088/v2/api-docs?group=api"))
.withConfig(config)
.build()
.toFolder(Paths.get("src/docs/asciidoc/generated/all"));
}
**run later**
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/BeanIntrospector
# what the NoClassDefFoundError ???
</details>
# 答案1
**得分**: 0
因为Maven依赖于冲突。
<details>
<summary>英文:</summary>
Because maven Rely on the conflict
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论