[GRADLE-2917] jacoco plugin may cause "can't change resolved configuration" Created: 07/Oct/13  Updated: 19/Nov/13  Resolved: 19/Nov/13

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.10-rc-1

Type: Bug
Reporter: Szczepan Faber Assignee: Szczepan Faber
Resolution: Fixed Votes: 1


 Description   

Jacoco plugin may cause following exception during configuration time: "You can't change a configuration which is not in unresolved state!"

Full stack trace:

https://gist.github.com/szczepiq/7ff21c2d6eaffbb90463/raw/9cbb389c58b8505474792aaee00210ed9f5ee03f/gistfile1.txt

In the code, I see that evaluation of the conventionMapping adds the dependency. I suggest we change that to use beforeResolve hook.



 Comments   
Comment by Alexander Moosbrugger [ 25/Oct/13 ]

I'm getting this exception "You can't change a configuration which is not in unresolved state!" when I run my multi-project build with --parallel flag. Removing the Jacoco plugin and running the same build again with --parallel works. Running the build with Jacoco plugin but without --parallel flag also works.

Comment by Szczepan Faber [ 25/Oct/13 ]

Workaround

Specify the tool dependency explicitly:

dependencies {
  jacocoAgent "org.jacoco:org.jacoco.agent:${project.jacoco.toolVersion}"
}
Comment by Alexander Moosbrugger [ 28/Oct/13 ]

Thank you, the workaround works perfectly.

Generated at Wed Jun 30 12:34:57 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.