Skip to content
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 6.4.1 on Java 14 fails with "Unresolved reference: id" in plugins DSL #13444

Closed
TimvdLippe opened this issue Jun 16, 2020 · 3 comments
Closed
Labels

Comments

@TimvdLippe
Copy link

Expected Behavior

Gradle on Java 14 compiles and runs

Current Behavior

Gradle on Java 14 fails with the following error (https://travis-ci.org/github/mockito/mockito/jobs/698916788):

e: /home/travis/build/mockito/mockito/settings.gradle.kts:38:3: Unresolved reference: id
FAILURE: Build failed with an exception.
* Where:
Settings file '/home/travis/build/mockito/mockito/settings.gradle.kts' line: 38
* What went wrong:
Script compilation error:
  Line 38:   id("com.gradle.enterprise").version("3.3.4")
             ^ Unresolved reference: id
1 error

Context

I am trying to enable the Java 14 build on Mockito: mockito/mockito#1945 Gradle 6.4.0 was reported to support Java 14, but I can't seem to figure out how to make that work. I haven't made any configuration changes, although I did start debugging by moving random things around (see the commits in the PR)

Steps to Reproduce

I honestly don't really know where to start, other than to clone Mockito and run the Gradle build on a Java 14 runtime. Sadly I lack the knowledge of Gradle and Kotlin to determine what the possible reproduction steps could be, as I am at a complete loss as to why this unresolved variable could pop up, but not in previous Java versions.

Your Environment

I can't run the build scan, as my Gradle fails compilation before we get to that step.

@TimvdLippe
Copy link
Author

Interestingly enough, @epeee just pointed out that the other Java 14 job we have did get past Gradle: https://travis-ci.org/github/mockito/mockito/jobs/698954197

@big-guy
Copy link
Member

big-guy commented Jun 17, 2020

Hmm, this looks very strange.

The build that fails is using a different cache key: https://travis-ci.org/github/mockito/mockito/jobs/698954215#L460

so I think it's possible this is somehow some bad state carried over from another build. Is it possible to disable to the caching to see if the problem goes away?

@TimvdLippe
Copy link
Author

I deleted the cache on https://travis-ci.org/github/mockito/mockito/caches for PR 1945. The build did not use a build cache: https://travis-ci.org/github/mockito/mockito/jobs/699476509 and I can confirm it resolved the issue.

For the poor soul who might later find this issue: have you tried turning it off and on again? 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants