I'm following the directions in the Spring Rest Docs reference doc with regards to the build configuration. But the 'snippets' attribute doesn't appear to be exposed to Asciidoctor when I try to do
include::{snippets}/....
but I get an asciidoctor "warning: dropping line containing reference to missing attribute: snippets"
If I remove the attribute reference and put in the path directly, the contents of the included file appear.
Here is the build.gradle file containing the Rest Docs/Asciidoctor info:
buildscript {
ext {
springBootVersion = '1.3.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id "org.asciidoctor.convert" version "1.5.3"
}
allprojects {
apply plugin: 'groovy'
apply plugin: 'idea'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com....'
ext {
si = [version: '4.1.7.RELEASE']
groovy = [version: '2.4.5']
newRelic = [version: '3.13.0']
jackson = [version: '2.6.2']
}
repositories {
mavenCentral()
maven {
url "http://artifacts...."
}
maven {
url "http://artifacts..../public-snapshots/"
}
}
sourceSets {
main {
groovy {
srcDirs = ['src/main/groovy']
}
}
}
test {
include "**/*Test.*"
exclude "**/*TestBase.*"
exclude "**/*IntegrationTest.*"
}
configurations {
all*.exclude group: 'org.eclipse.persistence'
all*.exclude group: 'org.codehaus.jackson'
all*.exclude group: 'org.slf4j', module: 'log4j-over-slf4j'
all*.exclude group: 'log4j'
}
dependencies {
compile "org.codehaus.groovy:groovy-all:${groovy.version}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson.version}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson.version}"
compile 'org.mockito:mockito-core:+'
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc:1.0.1.RELEASE'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}
}
ext {
snippetsDir = file('build/generated-snippets')
}
test {
outputs.dir snippetsDir
}
asciidoctor {
attributes 'snippets': snippetsDir
inputs.dir snippetsDir
dependsOn test
}
project(':...') {
dependencies {
compile project(':...')
}
}
Thanks.