我使用 Spring Rest Docs 和 JIB
当我这样做./gradlew build
时java -jar /some/build/libs/app.jar
。我可以在example.com/docs/asciidocname.html
.
但 docker 图像./gradlew jib
不包含此 url。
我想获得由 Spring Rest Docs 生成的 Api 文档,当我这样做时./gradlew jib
以下是我的一部分build.gradle
plugins {
id "org.asciidoctor.convert" version "2.4.0"
id "com.google.cloud.tools.jib" version "2.5.0"
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
querydsl.extendsFrom compileClasspath
asciidoctor
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
sourceCompatibility = '11'
dependencies {
/**
* RestDocs
*/
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation('org.springframework.restdocs:spring-restdocs-mockmvc')
}
test {
useJUnitPlatform {
includeEngines 'junit-jupiter'
}
}
/*************************
* Rest Docs
*************************/
asciidoctor {
dependsOn test
}
bootJar {
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}