in our project we are working with
springBoot 2.2.11
groovy 2.5.6
Our build.gradle looks like the following:
...
plugins {
id 'groovy'
id 'java'
id 'idea'
}
configurations {
testCompile.extendsFrom compile
testRuntime.extendsFrom runtime
...
}
...
sourceSets {
test {
java { srcDirs = ['src/test/java'] }
groovy {srcDirs = ['src/test/groovy'] }
}
...
}
...
springBoot {
buildInfo()
}
...
When we run gradlew test --info we get the following output:
...
> Task :bootBuildInfo
Caching disabled for task ':bootBuildInfo' because:
Build cache is disabled
Task ':bootBuildInfo' is not up-to-date because:
Value of input property 'properties.time' has changed for task ':bootBuildInfo'
...
> Task :compileJava UP-TO-DATE
...
Skipping task ':compileJava' as it is up-to-date.
...
> Task :compileTestGroovy
Caching disabled for task ':compileTestGroovy' because:
Build cache is disabled
Task ':compileTestGroovy' is not up-to-date because:
Input property 'astTransformationClasspath' file C:\projects\test-project\build\resources\main\META-INF\build-info.properties has changed.
The input changes require a full rebuild for incremental task ':compileTestGroovy'.
...
The build-info.properties file which is generated by spring-boots buildInfo step contains a build.time property which is updated on every execution.
The Java Compiler excludes this file apperently as the up-to-date check for :compileJava is returning true. However, the compileGroovy tasks includes this file into his sourceSet which is why it returns false on the up-to-date check.
I already tried the exclude option as follows with no success.
sourceSets {
test {
java { srcDirs = ['src/test/java'] }
groovy {
srcDirs = ['src/test/groovy']
excludes = [file("${buildDir}/resources/main/META-INF/build-info.properties")]
}
}
}
Any ideas on how to fix this? Idealy I would like to exclude the file build\resources\main\META-INF\build-info.properties from the up-to-date-check (or even the input sourceSet of compileGroovy).