Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11388

Does Groovy support Java Anntotation Processors?

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • None
    • None
    • None
    • None

    Description

      My question is simple : Does Groovy support Annotation Processors, like Mapstruct , Lombok or even custom Processors : https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html ?

      Something like: 

       

      import lombok.Builder
      import lombok.NonNull
      import lombok.Value
      @Value
      @Builder
      class TestE {
      …
      

       

      Please, no opionated answers, just facts and fact based explanations. There are many confuseing, strongly subjective and optinated posts in the web (Stacktrace and such, and even here), which trend towards no, you don‘t need it, i don't recommend, Lombok is a hack etc etc, but nothing really conclusive, substantial and objective. 

      My Testcase does seems to indicate that at least the Lombok Annotation Processor is not supported , see : https://github.com/chhex/groovylombok/tree/main

      But it also may well be, that i am missing something in the Gradle Build. 

      The enviroment i tested in: 

      $ ./gradlew -versionGradle 7.3.3Build time:   2021-12-22 12:37:54 UTC
      Revision:     6f556c80f945dc54b50e0be633da6c62dbe8dc71Kotlin:       1.5.31
      Groovy:       3.0.9
      Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
      JVM:          17.0.3 (Eclipse Adoptium 17.0.3+7)
      OS:           Mac OS X 13.2.1 aarch64

       

      Where the Groovy Version used by gradle is the same for the application.

      If this is a redundant post, sorry! I really like Groovy and am using it frequently, it would be just great to have good understanding of it‘s limitations, if that is the case.

      Best thanks for any help. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            chenrici Christoph Henrici
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: