Search code examples
javaspringspring-bootgradlegradlew

Type 'JavaCompile' property 'options.compilerArgumentProviders.apt$0.name' is missing an input or output annotation. error after upgrading to Gradle 7


After upgrading to Gradle 7.0 and making a build, I'm getting following failure:

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':compileJava' (type 'JavaCompile').
  - Type 'JavaCompile' property 'options.compilerArgumentProviders.apt$0.name' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#missing_annotation for more details about this problem.
  - Type 'JavaCompile' property 'options.compilerArgumentProviders.apt$0.publicType' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#missing_annotation for more details about this problem.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

I tried with --stacktrace but got no help from it. Thing here is that I'm not sure where to look in order to solve this as it doesn't mention any line in build.gradle file or some other hint as to where to look.


Solution

  • For anybody with the same issue: As noted by Bjørn, the apt plugin was the culprit in my Gradle build file. I removed the generic one (id "net.ltgt.apt") and the IntelliJ one (id "net.ltgt.apt-idea"), and my build file worked again.