{"action":"created","issue":{"url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin/issues/87","repository_url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin","labels_url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin/issues/87/comments","events_url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin/issues/87/events","html_url":"https://github.com/tbroyer/gradle-apt-plugin/issues/87","id":343134804,"node_id":"MDU6SXNzdWUzNDMxMzQ4MDQ=","number":87,"title":"Lombok APT Fail with Gradle v4.9","user":{"login":"aplatypus","id":67028,"node_id":"MDQ6VXNlcjY3MDI4","avatar_url":"https://avatars3.githubusercontent.com/u/67028?v=4","gravatar_id":"","url":"https://api.github.com/users/aplatypus","html_url":"https://github.com/aplatypus","followers_url":"https://api.github.com/users/aplatypus/followers","following_url":"https://api.github.com/users/aplatypus/following{/other_user}","gists_url":"https://api.github.com/users/aplatypus/gists{/gist_id}","starred_url":"https://api.github.com/users/aplatypus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aplatypus/subscriptions","organizations_url":"https://api.github.com/users/aplatypus/orgs","repos_url":"https://api.github.com/users/aplatypus/repos","events_url":"https://api.github.com/users/aplatypus/events{/privacy}","received_events_url":"https://api.github.com/users/aplatypus/received_events","type":"User","site_admin":false},"labels":[{"id":207165982,"node_id":"MDU6TGFiZWwyMDcxNjU5ODI=","url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin/labels/invalid","name":"invalid","color":"e6e6e6","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-07-20T14:43:58Z","updated_at":"2018-08-27T22:26:44Z","closed_at":"2018-07-20T15:03:23Z","author_association":"NONE","body":"\r\nI started to get this the build error:\r\n\r\n-  lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.ClassCastException\r\n\r\n... following an upgrade to Gradle v4.9.\r\n\r\nI have this ERROR using Lombok with Gradle on Linux.  On the command line.  I rolled back my project to Monday (today being Friday).  Same resultafter reverting my project to Monday 's check-point.\r\n\r\nI moved my Gradle version back to Gradle v4.8 using [SDKMAN](url)  and ran the same build command.\r\n-   It **_works_**!!\r\n\r\nSomething between Gradle 4.8 and Gradle 4.9 is breaking a very straightforward [Lombok](url) build.\r\n\r\nAs the error trace reports issues stemming from the `JavacAnnotationHandler` ... I begin by reporting this here.  Apparently this has occurred before but people were looking at IDE plug-in problems, etc.  Running my builds on the command line eliminated 99% of that noise.\r\n\r\nThe conclusion is that there is a misalignment between `gradle-apt-plugin` v0.17 and `gradle` v4.9.\r\n\r\n- Gradle v4.8 works.\r\n\r\nAnd that means it is possible that the Gradle v4.9 _**broke** my build_.\r\n-  There is noting I could find in the [Gradle v4.9 Release nodes](https://docs.gradle.org/4.9/userguide/publishing_maven.html) covering _known_ APT issues.\r\n\r\nEven though it is Obviously a Gradle change causing this ERROR, the root cause appears to be a APT processing error/mismatch.  For instance, I had a day and a half of fun organising the `publish` functionality to work with the upgrade.\r\n\r\nFrom my perspective, I feel it is quite important for the Gradle project to Inform plugin providers about these structural changes, BEFORE the release.  At least that way you can provide some kind of 'Warning' message.\r\n\r\n**2nd problem**\r\n\r\nThis message is emitted as a \"`Warning`\".  This situation is a definite, certified ERROR,  None of my source code that used Lombok compiles.  It is a project Build / Run / Test show-stopper.  No compilation.  Not successful build.\r\n\r\nTo be fair, I thing Lombok is reporting a \"`Warning`\" ... imho, when an annotation processor reports that it: \"Can Not process the code\"; this is a (project build) `Fatal Error`.\r\n\r\n**configuration**:\r\n```\r\nO/S name:       Linux\r\nGradle version: 4.9\r\nGroovy version: 2.4.12\r\nJava version:   1.8.0_172-b11 (vendor: Oracle Corporation)\r\n\r\nRoot project:   'root project 'foundation''\r\n  JAVA_HOME   = '/usr/lib/java/jre/home'\r\n  target...\r\n    JRE_HOME  = '/usr/lib/java/jre/home'\r\n    JDK_HOME  = '/usr/lib/java/jdk/home'\r\n\r\nnet.ltgt.apt = v0.17\r\nLombok       = v18.0\r\n```\r\n\r\n**related**:\r\n- [#1046 -- ClassCastException: Cannot cast HandleFieldDefaults to JavacASTVisitor (IntelliJ)](https://github.com/rzwitserloot/lombok/issues/1046)\r\n- [#197 -- Cannot cast lombok.javac.handlers.HandleFieldDefaults to lombok.javac.JavacAnnotationHandler](https://github.com/mplushnikov/lombok-intellij-plugin/issues/197)\r\n\r\n**stackdump** (see attachment for details):\r\n```\r\nwarning: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.ClassCastException: org.gradle.api.internal.tasks.compile.processing.IncrementalFiler cannot be cast to com.sun.tools.javac.processing.JavacFiler\r\npublic class Rpt\r\n       ^\r\n        at lombok.javac.apt.LombokProcessor.getJavacFiler(LombokProcessor.java:447)\r\n        at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:90)\r\n        at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:112)\r\n        at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:165)\r\n        at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:73)\r\n        at org.gradle.api.internal.tasks.compile.processing.DelegatingProcessor.init(DelegatingProcessor.java:57)\r\n        at org.gradle.api.internal.tasks.compile.processing.IsolatingProcessor.init(IsolatingProcessor.java:44)\r\n        at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:500)\r\n        at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:597)\r\n        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:690)\r\n        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)\r\n        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)\r\n        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)\r\n        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)\r\n        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)\r\n        at com.sun.tools.javac.main.Main.compile(Main.java:523)\r\n        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)\r\n        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)\r\n        at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:85)\r\n        at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:53)\r\n        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:50)\r\n        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:36)\r\n        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)\r\n        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)\r\n        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)\r\n        at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:49)\r\n        at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:35)\r\n        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:40)\r\n        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:27)\r\n        at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:156)\r\n        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:141)\r\n        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:113)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        :\r\n     etc.\r\n```\r\n[compileJava-FAILED.txt](https://github.com/tbroyer/gradle-apt-plugin/files/2214217/compileJava-FAILED.txt)\r\n"},"comment":{"url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin/issues/comments/416389231","html_url":"https://github.com/tbroyer/gradle-apt-plugin/issues/87#issuecomment-416389231","issue_url":"https://api.github.com/repos/tbroyer/gradle-apt-plugin/issues/87","id":416389231,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjM4OTIzMQ==","user":{"login":"tbroyer","id":173813,"node_id":"MDQ6VXNlcjE3MzgxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/173813?v=4","gravatar_id":"","url":"https://api.github.com/users/tbroyer","html_url":"https://github.com/tbroyer","followers_url":"https://api.github.com/users/tbroyer/followers","following_url":"https://api.github.com/users/tbroyer/following{/other_user}","gists_url":"https://api.github.com/users/tbroyer/gists{/gist_id}","starred_url":"https://api.github.com/users/tbroyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbroyer/subscriptions","organizations_url":"https://api.github.com/users/tbroyer/orgs","repos_url":"https://api.github.com/users/tbroyer/repos","events_url":"https://api.github.com/users/tbroyer/events{/privacy}","received_events_url":"https://api.github.com/users/tbroyer/received_events","type":"User","site_admin":false},"created_at":"2018-08-27T22:26:44Z","updated_at":"2018-08-27T22:26:44Z","author_association":"OWNER","body":"Out of curiosity, could Lombok work as a javac plugin? (the kind loaded with an `-Xplugin:Lombok`)"}}
{"actor":{"display_login":"tbroyer"}}