java - 配置警告中不存在此类代码段

标签 java javadoc asciidoc spring-restdocs

我正在使用 Spring rest auto docs 和 AsciiDoc 编写文档。以下是我的错误信息

错误信息

Section snippet 'auto-method-path' is configured to be included in the section but no such snippet is present in configuration

Section snippet 'auto-description' is configured to be included in the section but no such snippet is present in configuration

正在生成自动方法路径,因此我不知道警告来自何处。但是自动描述是根据文档, Controller 的 javaDoc 进行的,所以我不知道为什么没有生成该文档。

Java文档

/**
   * Returns a Customer
   *
   * @param id       the id of the customer
   * @return the customer
   */
  @GetMapping(path = "api/customer/{id}", produces = HAL_JSON_VALUE)

最佳答案

已修复。我在我的 Pom 上遗漏了这个:

   <execution>
            <id>generate-javadoc-json</id>
            <phase>compile</phase>
            <goals>
              <goal>javadoc-no-fork</goal>
            </goals>
            <configuration>
              <doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
              <docletArtifact>
                <groupId>capital.scalable</groupId>
                <artifactId>spring-auto-restdocs-json-doclet</artifactId>
                <version>2.0.9</version>
              </docletArtifact>
              <destDir>generated-javadoc-json</destDir>
              <reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
              <useStandardDocletOptions>false</useStandardDocletOptions>
              <show>package</show>
            </configuration>
          </execution>

关于java - 配置警告中不存在此类代码段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63581548/

相关文章:

java - Json 不适用于指定的 URL

java - Hibernate 中基本类型的 ArrayList

java - 在我的类(class)中使用 {@link classname} 作为外部 API

spring - 使用 Asciidoctor Maven 插件以 HTML 格式发布 API 文档时出现 Unresolved 指令错误

java - 在 Android 的单元测试中覆盖 SLF4J 实现

java - Java 中的枚举和多态性,扑克牌示例

java - Java API 核心类的 maven-javadoc-plugin 和 inheritDoc

java - 如何为我没有源代码的 .jar 文件中的类生成 JavaDoc 文档?

ms-word - 是否有一种合理的方法可以从 Asciidoc 或 Markdown 等轻型标记格式生成 Word 或 OpenOffice 文档?

python - 如何在 Python 中使用 AsciiDoc?