首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在war文件中包含spring-restdocs?

如何在war文件中包含spring-restdocs?
EN

Stack Overflow用户
提问于 2016-04-15 12:23:16
回答 1查看 607关注 0票数 2

将生成的spring-restdocs包含到war文件中的步骤是什么?

EN

回答 1

Stack Overflow用户

发布于 2016-04-20 07:41:58

按照以下步骤,我能够将rest文档集成到war文件中。

  1. 遵循spring website上的说明来配置您的项目,以生成文档文件并编写生成文档的测试用例。初始设置完成后,下一步是将文档集成到war文件中,您可以按照下面的instructions:
  2. Create a SpringMvcConfiguration进行操作

@EnableWebMvc公有类SpringMvcConfiguration扩展WebMvcConfigurerAdapter {私有静态最终资源String[] CLASSPATH_RESOURCE_LOCATIONS ={“classpath:/String[]/”};@Override public void addResourceHandlers(ResourceHandlerRegistry注册表){ if (!registry.hasMappingForPattern("/**")) {EnableWebMvc CLASSPATH_RESOURCE_LOCATIONS);}

  • 更新资源以包含ascii文档、复制资源的插件

.org.asciidoctor asciidoctor-maven-plugin1.5.2生成文档准备包process-asciidoc html手册src/main/asciidoc${snippetsDirectory}maven-resources-plugin 2.7复制资源准备包复制资源${project.build.outputDirectory}/公共/文档${project.build.directory}/生成的文档

插件条目负责生成文档并将其添加到target/classes文件夹。在这种情况下,在target/classes/public/docs.下

代码语言:javascript
复制
1. Finally when you deploy the war file the documentation is available under http://://docs/ In my case i created the index.adoc file and it generated index.html as the final output.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36638234

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档