Closed ashwanikumar04 closed 8 years ago
Hi,
If the AsciiDoctor task thinks he is up-to-date than run
gradlew clean asciidoctor
I hope this helps.
If you use Swagger2markup, I would love to get your GitHub Star in the code project https://github.com/Swagger2Markup/swagger2markup
Hi, RobWin Already starred it :+1:
I always run the same command which you gave. But still getting the same output. i.e. no pdf :(
Could you show me your Full gradle Script?
Here it is
buildscript {
ext {
springBootVersion = '1.3.0.RELEASE'
snippetsDir = file('build/generated-snippets')
}
ext['hibernate.version'] = '5.0.4.Final'
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.10.1'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.0.RELEASE'
classpath 'io.github.robwin:swagger2markup-gradle-plugin:0.9.1'
classpath 'io.spring.gradle:dependency-management-plugin:0.5.3.RELEASE'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'io.github.robwin.swagger2markup'
jar {
baseName = 'test'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
mavenLocal()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-hateoas')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.security.oauth:spring-security-oauth2:2.0.7.RELEASE')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.postgresql:postgresql:9.4-1201-jdbc41')
compile('javax.inject:javax.inject:1')
compile "io.springfox:springfox-swagger2:2.2.2"
compile("io.springfox:springfox-swagger-ui:2.1.1")
compile('net.kencochrane.raven:raven-logback:6.0.0')
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.1")
compile('org.projectlombok:lombok:1.12.6')
compile('org.hibernate:hibernate-java8:5.0.4.Final')
testCompile 'io.springfox:springfox-swagger2:2.2.2'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'io.springfox:springfox-staticdocs:2.2.3-SNAPSHOT'
testCompile 'junit:junit'
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'
testCompile 'com.fasterxml.jackson.module:jackson-module-jsonSchema:2.4.0'
testCompile 'io.github.robwin:assertj-swagger:0.1.2'
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}
ext {
asciiDocOutputDir = file("${buildDir}/asciidoc")
swaggerOutputDir = file("${buildDir}/swagger")
}
test {
systemProperty 'io.springfox.staticdocs.outputDir', swaggerOutputDir
}
convertSwagger2markup {
dependsOn test
inputDir swaggerOutputDir
pathsGroupedBy io.github.robwin.swagger2markup.GroupBy.TAGS
}
asciidoctor {
dependsOn convertSwagger2markup
sources {
include 'index.adoc'
}
backends = ['html5', 'pdf']
attributes = [
doctype : 'book',
toc : 'left',
toclevels : '3',
numbered : '',
sectlinks : '',
sectanchors: '',
hardbreaks : '',
generated : asciiDocOutputDir
]
}
Thx. I have some findings:
testCompile 'io.github.robwin:assertj-swagger:0.1.2'
for Swagger2Markup.testCompile
and not in compile
, because it removes many library dependencies and improves the start-up time of your application. Just add compile 'io.swagger:swagger-annotations:1.5.0'
so that you can use the Swagger annotations. Have a look at the demo.Some questions:
index.adoc
file? One more finding:
If you want to use Spring's io.spring.dependency-management
Gradle plugin and the Spring IO Platform, you should also add
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:2.0.0.RELEASE'
}
}
Did all the changes you mentioned. But still not working
Answers to questions:
New gradle file
buildscript {
ext {
springBootVersion = '1.3.0.RELEASE'
snippetsDir = file('build/generated-snippets')
}
ext['hibernate.version'] = '5.0.4.Final'
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.10.1'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.0.RELEASE'
classpath 'io.github.robwin:swagger2markup-gradle-plugin:0.9.1'
classpath 'io.spring.gradle:dependency-management-plugin:0.5.3.RELEASE'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'io.github.robwin.swagger2markup'
jar {
baseName = 'test'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
mavenLocal()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-hateoas')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.security.oauth:spring-security-oauth2:2.0.7.RELEASE')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.postgresql:postgresql:9.4-1201-jdbc41')
compile('javax.inject:javax.inject:1')
//compile 'io.swagger:swagger-annotations:1.5.0'
compile 'io.springfox:springfox-swagger2:2.3.0'
compile("io.springfox:springfox-swagger-ui:2.1.1")
compile('net.kencochrane.raven:raven-logback:6.0.0')
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.1")
compile('org.projectlombok:lombok:1.12.6')
compile('org.hibernate:hibernate-java8:5.0.4.Final')
testCompile 'io.springfox:springfox-swagger2:2.3.0'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'io.springfox:springfox-staticdocs:2.2.3-SNAPSHOT'
testCompile 'junit:junit'
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'
testCompile 'com.fasterxml.jackson.module:jackson-module-jsonSchema:2.4.0'
}
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:2.0.0.RELEASE'
}
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}
ext {
asciiDocOutputDir = file("${buildDir}/asciidoc")
swaggerOutputDir = file("${buildDir}/swagger")
}
test {
systemProperty 'io.springfox.staticdocs.outputDir', swaggerOutputDir
}
convertSwagger2markup {
dependsOn test
inputDir swaggerOutputDir
pathsGroupedBy io.github.robwin.swagger2markup.GroupBy.TAGS
}
asciidoctor {
dependsOn convertSwagger2markup
sources {
include 'index.adoc'
}
backends = ['html5', 'pdf']
attributes = [
doctype : 'book',
toc : 'left',
toclevels : '3',
numbered : '',
sectlinks : '',
sectanchors: '',
hardbreaks : '',
generated : asciiDocOutputDir
]
}
Can you share the project on GitHub?
Btw you starred this project and not https://github.com/Swagger2Markup/swagger2markup :)
Yep I did that :)
thx :)
Any update on what is the problem :)
Not yet. I can't run your project, because I dont have MongoDB installed.
But I think your index.adoc
file is missing in the folder /src/docs/asciidoc
Let me disable mongo db
It worked. Was missing index.doc on the proper location :+1:
Nice! :dancers:
Hello: I am following the same code which is in the demo repository. I am able to generate the .adoc file but PDF file is not generated. Following is my gradle settings
In the logs I get
I am not sure what is wrong in my configuration. Please have a look. Thanks, Ashwani