【发布时间】:2020-09-13 09:00:34
【问题描述】:
我设法将 swagger 核心添加到我的 Web 应用程序,但我找不到将 swagger-ui 添加到我的 jersey jax-rs Web 应用程序的解决方案。
这里除外:https://github.com/swagger-api/swagger-samples/blob/2.0/java/java-jersey2-webxml/pom.xml
有大量的 Spring Boot 示例,但不适用于带有 web.xml 的 jersey jax-rs。
但是,在某些地方,我看到了说明,从 Github 中检查 swagger-UI 源代码的“dist”目录,然后将所有内容添加到“webapp”目录,然后更改索引中的 URL。 html。
我尝试使用 maven com.googlecode.maven-download-plugin 和 maven-resources-plugin 并手动添加 index.html 但对我不起作用。
还有其他方法可以让我自动执行此操作吗?那就是自动将swagger-ui添加到jersey jax-rs web application?
看到maven仓库有;
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>3.25.4</version>
</dependency>
但找不到它的任何用法。
感谢任何重定向到我可以参考的来源。
【问题讨论】:
标签: web-applications jersey jax-rs swagger-ui web.xml