After upgrading to gradle 4.0 the build fails "A deadlock was detected while resolving the task outputs for . This can be caused, for instance, by a task output causing dependency resolution


(Schaaf, Martin) #1

Hej,

we use the Jarjar plugin in our project and run after upgrading to version 4.0 from version 3.5 into to the following issue.
A deadlock was detected while resolving the task outputs for :bla-base:jarjar-repackage_bla-gson-2.8.0.jar. This can be caused, for instance, by a task output causing dependency resolution.
An attempt was made to execute build operations inside of a resource lock transform. Aborting to avoid a deadlock.

We use this slightly modified version of the Jarjar plugin https://github.com/Dica-Developer/jarjar
I would like to understand what the error should tell me.
I would like to understand where I need to start fixing the issue, e.g. in the plugin or the build script.

Thanks in advance,
Martin.


(Denis) #2

Hi,
I had the same problem in one legacy project which had such things:
configurations {
axis2
}

task build_autoServiceGenerate(type: JavaExec) {

outputs.files configurations.axis2, …
}

So i removed configurations.axis2 from outputs.files and it worked!


(Stefan Oehme) #3

Some task output contained a dependency Configuration, which makes no sense at all.

Don’t add Configurations as task outputs. In the case of the JarJar plugin it was marking “untouched inputs” as an output, which conceptually makes no sense. Outputs should only be the things that a task physically creates.


(Schaaf, Martin) #4

@denis111 and @st_oehme Thank you for your answers and help. With you answers I am able to fix the issue.