Lombok Gradle Plugin: Upgrading from 8.6 to 8.10 generates new gradle error

108 views
Skip to first unread message

Frank Kelly

unread,
Sep 5, 2024, 8:15:23 PM9/5/24
to Project Lombok
Doesn't appear to be a bug - more of a Gradle related question . . . .

But am using Gradle 8.7 and when I upgrade from Lombok 8.6 to 8.10 I now get this error

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':entity-client:generateEffectiveLombokConfig' (type 'LombokConfig').
  - Gradle detected a problem with the following location: '/Users/fkelly/dev/platform2-entity/entity-client/build/openapi-source/src/main/java'.

    Reason: Task ':entity-client:generateEffectiveLombokConfig' uses this output of task ':entity-client:generateClientCode' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':entity-client:generateClientCode' as an input of ':entity-client:generateEffectiveLombokConfig'.
      2. Declare an explicit dependency on ':entity-client:generateClientCode' from ':entity-client:generateEffectiveLombokConfig' using Task#dependsOn.
      3. Declare an explicit dependency on ':entity-client:generateClientCode' from ':entity-client:generateEffectiveLombokConfig' using Task#mustRunAfter.

    For more information, please refer to https://docs.gradle.org/8.10/userguide/validation_problems.html#implicit_dependency in the Gradle documentation
.

It is a multi-project build - with two subprojects
The solution I found here https://github.com/freefair/gradle-plugins/discussions/482 appears to have worked for one but not the other subproject
sourceSets.main.java.srcDirs generateClientCode

I tried adding
generateEffectiveLombokConfig.dependsOn tasks.openApiGenerate
in the second project but Gradle told me 
A problem occurred evaluating project ':entity-service'.
> Could not get unknown property 'generateEffectiveLombokConfig' for project ':entity-service' of type org.gradle.api.Project.


Any advice or guidance appreciated,

Thanks!

Frank 

Frank Kelly

unread,
Sep 6, 2024, 9:58:21 AM9/6/24
to Project Lombok
FYI I found a work-around after some Gradle googling but I'm not happy with it.

// Due to Gradle dependency error when upgrading from Lombok 8.6 to 8.10
// Based on solution https://discuss.gradle.org/t/implicit-dependency-among-tasks-but-the-tasks-do-not-exist/46127
tasks.configureEach {
    if (name == "generateEffectiveLombokConfig") {
        mustRunAfter(tasks.generateClientCode)
    }
}


Is there an alternative? Perhaps something more concise?

-Frank

Reply all
Reply to author
Forward
0 new messages