gradle doesn't executed task

Hello,

I'm trying to build jar file with teamcity and gradle task and it builds with no html files inside. When i run manually ./gradlew build i got full with html files inside jar, but when i run build with teamcity i have no html files inside jar. below my build.gradle file, task Gradle with build.gradle, but step processResources does not executed as i understood (no files in build/resources/main/static/docs as folder docs inside it does not appear).

processResources {
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}

How to solve this, please help.

import org.asciidoctor.gradle.AsciidoctorTask

buildscript {
ext {
kotlinVersion = '1.2.61'
springBootVersion = '2.0.1.RELEASE'
}
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}"
classpath "org.jetbrains.kotlin:kotlin-noarg:${kotlinVersion}"
classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.6"
classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.19.2"
}
}

apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'kotlin-jpa'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'com.palantir.docker'
apply plugin: 'kotlin-kapt'

group = 'com.test.register'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}

repositories {
mavenCentral()
}

ext {
snippetsRegisterDir = file('build/generated-snippets/register')
snippetsApiDir = file('build/generated-snippets/api')
restdocsVersion = '2.0.0.RELEASE'
}

dependencies {
asciidoctor "org.springframework.restdocs:spring-restdocs-asciidoctor:$restdocsVersion"
kapt "org.springframework.boot:spring-boot-configuration-processor"

compile("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
compile('org.springframework.security:spring-security-web:5.0.4.RELEASE')
compile('org.springframework.security:spring-security-config:5.0.4.RELEASE')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.hibernate:hibernate-core:5.3.1.Final')
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
compile("org.springframework.boot:spring-boot-starter-jetty")
compile('org.springframework.boot:spring-boot-starter-webflux')
compile("org.springframework.boot:spring-boot-starter-security")
compile('org.springframework.boot:spring-boot-starter-data-mongodb')
compile('com.fasterxml.jackson.module:jackson-module-kotlin')
compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310')
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.jetbrains.kotlin:kotlin-reflect")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:0.22.5")
compile "org.springframework.restdocs:spring-restdocs-core:$restdocsVersion"
compile("com.github.briandilley.jsonrpc4j:jsonrpc4j:1.5.3")
compile("org.liquibase:liquibase-core:3.6.1")
compile('com.vladmihalcea:hibernate-types-52:2.2.0')
compile('org.apache.commons:commons-io:1.3.2')
compile('org.apache.commons:commons-lang3:3.7')
compile('org.apache.httpcomponents:httpclient:4.5.1')
runtime('org.postgresql:postgresql')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('io.projectreactor:reactor-test')
testCompile('org.springframework.security:spring-security-test:4.0.0.RELEASE')
testCompile "org.springframework.restdocs:spring-restdocs-mockmvc:$restdocsVersion"
}

test {
finalizedBy asciidoctor
}

asciidoctor {
dependsOn "generateRegisterDoc", "generateApiDoc"
}


task generateRegisterDoc (type: AsciidoctorTask, description: 'Generate register doc', group: 'Documentation') {
backends = ['html5']
options doctype: 'book'
attributes = [
'imagesdir' : './images',
'snippets' : snippetsRegisterDir,
'encoding' : 'utf-8'
]
inputs.dir snippetsRegisterDir
outputDir "build/asciidoc"
sourceDir 'src/main/asciidoc'
sources {
include 'register.adoc'
}
}
task generateApiDoc (type: AsciidoctorTask, description: 'Generate api doc', group: 'Documentation') {
backends = ['html5']
options doctype: 'book'
attributes = [
'imagesdir' : './images',
'snippets' : snippetsApiDir,
'encoding' : 'utf-8'
]
inputs.dir snippetsApiDir
outputDir "build/asciidoc"
sourceDir 'src/main/asciidoc'
sources {
include 'api.adoc'
}
}

processResources {
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}

docker {
name "test-${jar.baseName}"
files jar.archivePath
buildArgs(['JAR_FILE': "${jar.archiveName}"])
}
0
2 comments

Hi,

 

Have you considered adding it to the tasks executed during the build step? They can be added in the build configuration directly. You could also enable debug in gradle to see whether the steps are actually happening for confirmation. If none of this works, please follow the steps here: https://confluence.jetbrains.com/display/TCD18/Common+Problems#CommonProblems-BuildworkslocallybutfailsormisbehavesinTeamCity

0
Avatar
Permanently deleted user

Thank you for your response.

Yes problem was that this resources compiled after think and if I run second build without tests and clean they appear in output folder so at this moment I've just added one step to build again ))) will speak with our developers... 

0

Please sign in to leave a comment.