New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gradle assemble error: "Value for metadata of project :project2 has not been calculated yet" #20330
Comments
I'm having a similar problem. What's the reason? Do I need to adapt 7.4 to make any changes? |
I'm also affected. Please let me know if there's anything I could try to give you more info about the problem. |
I am seeing this issue intermittently as well on linux (appears to be some sort of configuration race condition). Any update on this? |
This appears to be due to configuration resolving performed during sync. Is this not supported now or for some other reason? What should do if I need to use the result of configuration.resolve() for task increments?If any update on this,please reply. |
This should be a bug in 7.4. Module dependencies need to be in alphabetical order. There are two ways to avoid this problem. 1、
2、 |
I also resolved the problem in that way. |
As a workaourd solution, this works in my environment also. |
This issue still happens with Gradle 7.5. |
We did not met the issue in 7.4.2, but in 7.5. |
It's happening in 7.5.1 as well. I notice that it does not happen if I leave out the jmockit javaagent parameter to the JVM for the test task, but leave in the gradle dependency on jmockit. Edit: You would only need to remove it for one of the projects, and it does not matter which one. |
I discovered that the reason it fails is because the "test" task is getting instantiated and configured when evaluating the testFixtures source sets; this happens even when using the on demand method of configuration Another workaround is to place the jvmargs configuration inside of a
This has to go into the subprojects that are providing the testFixture sources. So the real fix for this would be to find out why the test task is getting instantiated and configured when the testFixture sources are getting built and prevent that from happening. |
This seems to still happen with Gradle 8. |
Same issue happens still with Gradle 8.1. |
Sorry for the late reply. Thank you for providing a valid report. The issue is in the backlog of the relevant team, but this area of Gradle is currently not a focus one, so it might take a while before a fix is made. Can anyone confirm that it's still an issue in 8.4? |
Yes, this is still an issue in Gradle 8.4.
I would assume that subprojects are a basic Gradle functionality. Can you at least describe a workaround or tell us what features to avoid? |
@HaasJona thanks for the reply. Subprojects should work fine. At first glance, the problem is in |
@ov7a We aren't using that plug-in. If someone wants to investigate, the build can be accessed on https://gitlab.nerz-ev.de/ERZ/SWE_de.bsvrz.kernsoftware/-/pipelines/24121 (you might need to register, but it should otherwise be public) |
@HaasJona Sorry, I can't find a way to register there. Could you please upload the build as a file? |
Sorry, can you try to execute the following commands?
|
@HaasJona Yeah, I can download it, thanks. |
I think the issue is that there's a circular evaluation order introduced by lines like this:
This causes the classpath of the Test task to be evaluated at configuration time, which in turns evaluates the testRuntimeClasspath, which requires the metadata of the current project to be calculated. In #20330 (comment), you can see we're resolving a configuration in The underlying problem is that you need to avoid dependency resolution at configuration time. In this particular example, you could introduce a |
When upgrading from gradle 7.3.3 to 7.4.1, an existing project execution (command is './gradlew clean assemble') reports following error:
Value for metadata of project :project2 has not been calculated yet
Expected Behavior
It's expected that the gradle assemble task succeeds without the issue.
Current Behavior
Gradle assemble task reports the mentioned error, and stops running. Output:
Context
gradle 7.3.3 works well, but gradle 7.4.1 has this issue.
Steps to Reproduce
Steps to reproduce:
java-test-fixtures plugin is used by all the projects, and jmockit dependency is used by both sub-projects.
Please download and run gradle task with the attached example project prepared to reproduce the issue:
test-project.tar.gz
Your Environment
Environment information:
The text was updated successfully, but these errors were encountered: