简体   繁体   English

使用maven插件的离线招摇文档

[英]Offline swagger documentation using maven plugin

I am trying to generate swagger documentation, for that I need to start the server. 我正在尝试生成swagger文档,因为我需要启动服务器。 I Want to generate swagger documentation offline (with out starting the server), I just got this link swagger-codegen-maven-plugin 我想离线生成swagger文档(没有启动服务器),我只是得到了这个链接swagger-codegen-maven-plugin

But when I added above plugin to POM.xml (Suppose to generate HTML doc during maven build i feel), it is not at all doing anything. 但是当我将上面的插件添加到POM.xml中时(假设在maven build期间生成HTML文档我觉得),它根本就没有做任何事情。 Please help. 请帮忙。

Take a look at this plugin: https://github.com/teamcarma/swagger-jaxrs-doclet 看看这个插件: https//github.com/teamcarma/swagger-jaxrs-doclet

As the JSON resource listing is generated offline from source code it means that you do not need to add any runtime dependencies to your project and avoid potential headaches with different jar versions and jaxrs implementations. 由于JSON资源列表是从源代码离线生成的,这意味着您不需要向项目添加任何运行时依赖项,并避免使用不同jar版本和jaxrs实现的潜在麻烦。 This also avoids increasing the size of your artifacts 这也避免了增加工件的大小

To generate the HTML documentation, you need to set the value of the language tag in the configuration to HTML. 要生成HTML文档,您需要将配置中的语言标记的值设置为HTML。 In the example from your link, it is set to java . 在链接的示例中,它设置为java Change it to html . 将其更改为html If you need both Java and HTML to be generated, have two execution blocks, one for Java, one for HTML. 如果需要生成Java和HTML,则需要两个execution块,一个用于Java,一个用于HTML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM