将生成的spring-restdocs包含到war文件中的步骤是什么?
发布于 2016-04-20 07:41:58
按照以下步骤,我能够将rest文档集成到war文件中。
@EnableWebMvc公有类SpringMvcConfiguration扩展WebMvcConfigurerAdapter {私有静态最终资源String[] CLASSPATH_RESOURCE_LOCATIONS ={“classpath:/String[]/”};@Override public void addResourceHandlers(ResourceHandlerRegistry注册表){ if (!registry.hasMappingForPattern("/**")) {EnableWebMvc CLASSPATH_RESOURCE_LOCATIONS);}
.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.下
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.
https://stackoverflow.com/questions/36638234
复制相似问题