Giter Site home page Giter Site logo

Comments (4)

jbennett2091 avatar jbennett2091 commented on June 12, 2024

The easy work-around is to make it an implementation dependency, instead of a compileOnly. Has implications, and compileOnly would be preferred, but gets you running

from gradle-lint-plugin.

Grimoren avatar Grimoren commented on June 12, 2024

Actually it still identifies it as not used in implementation, as well.

from gradle-lint-plugin.

mikesmithson avatar mikesmithson commented on June 12, 2024

You might want to just use the gradle-lombok plugin instead and not have to deal dependency scopes for lombok anymore: https://plugins.gradle.org/plugin/io.freefair.lombok

from gradle-lint-plugin.

dbolger avatar dbolger commented on June 12, 2024

The Getter annotation and any other annotation that has a RetentionPolicy @Retention(RetentionPolicy.SOURCE) will always fail. The Gradle Lint plugin uses ASM to visit compiled class files and review if dependencies declared are in use in said compiled classes. JLS 9.6.4.2 states that the information about this annotation will not be present in the compiled class file:

Annotations may be present only in source code, or they may be present in the binary form of a class or interface. An annotation that is present in the binary form may or may not be available at run time via the reflection libraries of the Java SE Platform. The annotation type java.lang.annotation.Retention is used to choose among these possibilities.

If an annotation a corresponds to a type T, and T has a (meta-)annotation m that corresponds to java.lang.annotation.Retention, then:
...
If m has an element whose value is java.lang.annotation.RetentionPolicy.SOURCE, then a Java compiler must ensure that a is not present in the binary representation of the class or interface in which a appears.

https://docs.oracle.com/javase/specs/jls/se14/html/jls-9.html#jls-9.6.4.2

The only way I can imagine one would be able to determine if these annotations were being used would be to investigate the source file itself.

from gradle-lint-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.