franzbecker / gradle-lombok

Gradle plugin for Lombok support
Apache License 2.0
182 stars 22 forks source link

Add support for Gradle 7 #79

Closed emlun closed 3 years ago

emlun commented 3 years ago

Hi! The :verifyLombok task fails in Gradle 7 because the compileOnly configuration is no longer resolvable:

> Task :verifyLombok FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':verifyLombok'.
> Resolving dependency configuration 'compileOnly' is not allowed as it is defined as 'canBeResolved=false'.
  Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'compileOnly' should be resolved.

Instead, it appears that libraries and plugins should use the compileClasspath configuration to resolve dependencies - for example to retrieve a JAR file, as in the case of VerifyLombok.

Included here are a couple of tests that expose the issue and a fix for it. It seems like this maintains compatibility all the way back to Gradle 2. :slightly_smiling_face:

emlun commented 3 years ago

Thanks for taking a look!

While this passes the tests, it also modifies the tests – so I'm not sure it would actually work.

That's a fair point. I tried to organize the changes in commits of

  1. Expand test coverage while still passing existing tests,
  2. Add a new, failing test for Gradle 7,
  3. Make the new test pass.

Would you like some other organization of the changes?

There should be another way for the VerifyLomboktask to somehow access this?

I'm not sure what you mean by this, but maybe my replies to your inline comments will help there.

franzbecker commented 3 years ago

Hey @emlun, this is now published as v5.0.0. Sorry for the delay – had to migrate this project from travis-ci.org to travis-ci.com

emlun commented 3 years ago

Cool, I'm happy to have helped! Sorry for me being slow to respond too. Thanks again!