我已经成功地使用Spring编写了一个测试并生成了代码段。
当我使用Asciidoctor Maven plugin以HTML格式发布API文档时,将生成HTML。
但是,HTML显示了以下错误。我的包含似乎不像预期的那样起作用。我想知道会有什么问题。
api-guide.adoc - include::/opt/caweb/thoughtworks/go-agent/pipelines/xxx_Build/xxx-source/target/generated-snippets/creating-grouping/curl-request.adoc[]中未解析的指令
这里是POM.xml的asciidoctor-maven-plugin和maven-resources-plugin部分。
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>html</backend>
<doctype>book</doctype>
<attributes>
<snippets>${project.build.directory}/generated-snippets</snippets>
</attributes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/static/docs</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/generated-docs</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>下面是我的api-Guide.adoc的包含部分:
include::{snippets}/create-grouping/curl-request.adoc[]谢谢你的帮助!
发布于 2016-02-08 12:33:44
您是否正在配置您确定的插件以包括您的文档文件?
https://github.com/spring-projects/spring-restdocs/blob/master/docs/src/docs/asciidoc/getting-started.adoc
检查这里
发布于 2016-06-24 11:44:25
我解决了这一问题,我将asciidoctor上的相位从prepare-package改为包。
https://stackoverflow.com/questions/35137874
复制相似问题