Björn Mayer
12/05/2023, 12:51 PMval openTelemetryJarFileName = "opentelemetry-javaagent-1.25.1.jar"
val copyOpenTelemetryJavaAgent by tasks.registering(Copy::class) {
from(layout.projectDirectory.dir("resources/opentelemetry"))
into(jibAppRoot)
doLast {
// Required for reproducible builds.
jibAppRoot.file(openTelemetryJarFileName).asFile.setLastModified(0)
}
}
cannot serialize Gradle script object references as these are not supported with the configuration cache.I guess it does not like, that I am using a variable inside the task. How do I solve this? I am thinking about a task, that generates
opentelemetry-javaagent-1.25.1.jar
as output, which I can then (hopefully) use as input for the copyOpenTelemetryJavaAgent
taskVampire
12/05/2023, 1:05 PMdoLast
do a val openTelemetryJarFileName = openTelemetryJarFileName
that should fix it.Björn Mayer
12/05/2023, 1:58 PMVampire
12/05/2023, 2:31 PMBjörn Mayer
12/05/2023, 2:48 PMBjörn Mayer
12/06/2023, 10:40 AMVampire
12/06/2023, 10:48 AMgw copyOpenTelemetryJavaAgent
with CC enabled, you should get the same error.
Unless on CI there is maybe some init script further changing your build or similar.