I have a problem with circular task dependencies in a very simple build file.
I’m using jasperreports-gradle-plugin, which provides a task (compileAllReports) for compiling report designs into reports.
One of my reports uses a class from src/main/java
, so the report compilation task depends on the runtimeClasspath (which also contains the required JasperReports library jars).
The plugin provides a way to do that:
jasperreports {
classpath.from(project.sourceSets.main.runtimeClasspath)
}
But now I need those compiled reports available as resources on the classpath.
So I tried to add the following:
sourceSets.main.resources.srcDir(compileAllReports)
But now I get the following error:
Circular dependency between the following tasks:
:classes
\--- :processResources
\--- :compileAllReports
\--- :classes (*)
This does make sense, but I’m wondering if there is a way to achieve what I’m trying to do?