小编pep*_*psi的帖子

使用 Spring Restdoc 时配置 asciidoctor

我正在采用 Spring Rest Docs,并且测试成功创建了 *.adoc 文件。

我在 src/docs/asciidoc 目录中创建了 api-guide.doc 文件来创建 html,但是当我将 asciidoc 作为 gradle 任务运行时,它会产生以下错误。

Some problems were found with the configuration of task ':asciidoctor' (type 'AsciidoctorTask').
  - In plugin 'org.asciidoctor.convert' type 'org.asciidoctor.gradle.AsciidoctorTask' method 'asGemPath()' should not be annotated with: @Optional, @InputDirectory.
Run Code Online (Sandbox Code Playgroud)

我用spring初始化器初始化了项目,所以我相信gradle依赖没有问题。

plugins {
    id 'org.springframework.boot' version '2.5.3'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'org.asciidoctor.convert' version '1.5.8'
    id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories { …
Run Code Online (Sandbox Code Playgroud)

spring-boot asciidoctor spring-restdocs

7
推荐指数
1
解决办法
2331
查看次数

标签 统计

asciidoctor ×1

spring-boot ×1

spring-restdocs ×1