What kind of dependency is this?

Hi,

In the root project, I’m using a copy task, that is copiing files from a configuration,
that depends on a sub projects Configuration.
If the sub project’s directory is missing, it’s not possible to execute any tasks in the root project,
because evaluation is failing.
rootproject is evaluated before subproject, so I expected an unsatisfied evaluation dependency.
But if the sub project’s directory is there, evaluation order is the same and succeeds.

So what kind of dependency is this and can it be avoided (beside checking if sub projects are there)?

Example:

$ gradle --info
Starting Build
Settings evaluated using settings file ‘/rootproject/settings.gradle’.
Projects loaded. Root project using build file ‘/rootproject/build.gradle’.
Included projects: [root project ‘rootproject’, project ‘:subproject’]
Evaluating root project ‘rootproject’ using build file ‘/rootproject/build.gradle’.
Compiling build file ‘/rootproject/build.gradle’ using SubsetScriptTransformer.
Compiling build file ‘/rootproject/build.gradle’ using BuildScriptTransformer.
Evaluating project ‘:subproject’ using build file ‘/rootproject/subproject/build.gradle’.

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘/rootproject/build.gradle’ line: 34

  • What went wrong:
    A problem occurred evaluating root project ‘rootproject’.

Could not resolve all dependencies for configuration ‘:DependencyConf’.
Configuration with name ‘artifactConf’ not found.

configurations{ DependencyConf }

dependencies {
DependencyConf project(path: ':subproject, configuration: ‘artifactConf’)
}

task internalEmbeddedCopyDeps(type: Copy, dependsOn: [configurations.DependencyConf]){

configurations.DependencyConf.filter {it.toString().endsWith(".jar")}.each {
	from it
}
into new File('jars/')

}

It worked putting the copy into a closure as stated here: