Lombok fails with JDK 10
krzyk opened this issue ยท 88 comments
EDIT: See #1572 (comment) for minimal example
I tried to build a project with JDK 10, so we could make lombok work with it sooner than it was with JDK 9.
(the build works with JDK 9, so changed compiler to JDK 10)
lombok 1.6.20
Maven version:
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
Maven home: /opt/apache-maven-3.5.2
Java version: 10-ea, vendor: Oracle Corporation
Java home: /opt/jdk-10
Default locale: en_DK, platform encoding: UTF-8
OS name: "linux", version: "4.14.14", arch: "amd64", family: "unix"
Java version:
java 10-ea 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10-ea+42)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10-ea+42, mixed mode)
...
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>10</source>
<target>10</target>
<compilerArgs>
<arg>-Xlint:all,-processing,-cast,-serial,-try</arg>
</compilerArgs>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
...
And the maven build fails with:
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ manager-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 214 source files to /home/target/classes
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs
WARNING: Please consider reporting this to the maintainers of lombok.javac.apt.LombokProcessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.265 s
[INFO] Finished at: 2018-02-05T10:16:24+01:00
[INFO] Final Memory: 54M/197M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Fatal error compiling
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1086)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.codehaus.plexus.compiler.CompilerException: java.lang.ExceptionInInitializerError
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:173)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:158)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.ExceptionInInitializerError
at lombok.javac.handlers.HandleGetter.<clinit> (HandleGetter.java:303)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java:374)
at lombok.core.SpiLoadUtil$1$1.next (SpiLoadUtil.java:111)
at lombok.javac.HandlerLibrary.loadAnnotationHandlers (HandlerLibrary.java:171)
at lombok.javac.HandlerLibrary.load (HandlerLibrary.java:156)
at lombok.javac.JavacTransformer.<init> (JavacTransformer.java:44)
at lombok.javac.apt.LombokProcessor.init (LombokProcessor.java:89)
at lombok.core.AnnotationProcessor$JavacDescriptor.want (AnnotationProcessor.java:87)
at lombok.core.AnnotationProcessor.init (AnnotationProcessor.java:140)
at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init (AnnotationProcessor.java:69)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init> (JavacProcessingEnvironment.java:674)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next (JavacProcessingEnvironment.java:771)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:866)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100 (JavacProcessingEnvironment.java:110)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1202)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1311)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1250)
at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:928)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:142)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags
at java.lang.ClassLoader.findClass (ClassLoader.java:711)
at java.lang.ClassLoader.loadClass (ClassLoader.java:566)
at lombok.launch.ShadowClassLoader.loadClass (ShadowClassLoader.java:422)
at java.lang.ClassLoader.loadClass (ClassLoader.java:499)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java:291)
at lombok.javac.JavacTreeMaker$SchroedingerType.getFieldCached (JavacTreeMaker.java:156)
at lombok.javac.JavacTreeMaker$TypeTag.typeTag (JavacTreeMaker.java:245)
at lombok.javac.Javac.<clinit> (Javac.java:155)
at lombok.javac.handlers.HandleGetter.<clinit> (HandleGetter.java:303)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java:374)
at lombok.core.SpiLoadUtil$1$1.next (SpiLoadUtil.java:111)
at lombok.javac.HandlerLibrary.loadAnnotationHandlers (HandlerLibrary.java:171)
at lombok.javac.HandlerLibrary.load (HandlerLibrary.java:156)
at lombok.javac.JavacTransformer.<init> (JavacTransformer.java:44)
at lombok.javac.apt.LombokProcessor.init (LombokProcessor.java:89)
at lombok.core.AnnotationProcessor$JavacDescriptor.want (AnnotationProcessor.java:87)
at lombok.core.AnnotationProcessor.init (AnnotationProcessor.java:140)
at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init (AnnotationProcessor.java:69)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init> (JavacProcessingEnvironment.java:674)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next (JavacProcessingEnvironment.java:771)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:866)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100 (JavacProcessingEnvironment.java:110)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1202)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1311)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1250)
at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:928)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:142)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
When I do:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>10</source>
<target>10</target>
<fork>true</fork>
<compilerArgs>
<arg>-Xlint:all,-processing,-cast,-serial,-try</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
</compilerArgs>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
I get a different error messages with problematic __
:
[ERROR] symbol: class __
[ERROR] /home/data/CreateNewKeyCollectionCommandHandler.java:[15,42] error: cannot find symbol
Probably because of:
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
Did you tried this one for @Autowired?
from JDK8:
@RequiredArgsConstructor(onConstructor_={@AnnotationsGohere}) // note the underscore after onConstructor.
@yurii-polishchuk Actually I did it other way, I just removed the @Autowired
annotation (I don't need it as I have only 1 constructor).
But after that I get errors which I don't know if are a result of lombok or query-dsl (which I use) or maven-compiler 3.7.0:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.212 s
[INFO] Finished at: 2018-02-05T11:06:02+01:00
[INFO] Final Memory: 35M/127M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Compilation failure: Compilation failure:
[ERROR] bad path element "/home/data/.m2/repository/org/glassfish/jaxb/jaxb-core/2.3.0/istack-commons-runtime-3.0.5.jar": no such file or directory
[ERROR] /home/data/dev/manager-api/src/main/java/com/apikeymanager/domain/tapioca/repository/ChangeEventJPAProvider.java:[10,53] error: cannot find symbol
[ERROR] symbol: class QChangeEvent
[ERROR] location: package com.apikeymanager.domain.tapioca
[ERROR] /home/data/dev/manager-api/src/main/java/com/apikeymanager/domain/tapioca/repository/ChangeEventJPAProvider.java:[10] error: static import only from classes and interfaces
[ERROR] /home/data/dev/manager-api/src/main/java/com/apikeymanager/domain/collection/repository/KeyCollectionJPAProvider.java:[21,56] error: cannot find symbol
OK, I've created a minimal working example of problem with JDK 10 at https://github.com/krzyk/lombok-jdk10-example
doing mvn clean verify
on the above in JDK 10 results in:
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ lombok-jdk10 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/dev/moje/lombok-jdk10/target/classes
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs
WARNING: Please consider reporting this to the maintainers of lombok.javac.apt.LombokProcessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
symbol: method setBar(java.lang.String)
location: class com.kirela.lombok.Foo
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.058 s
[INFO] Finished at: 2018-02-06T14:07:16+01:00
[INFO] Final Memory: 16M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project lombok-jdk10: Compilation failure
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
[ERROR] symbol: method setBar(java.lang.String)
[ERROR] location: class com.kirela.lombok.Foo
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
So lombok is not generating getters at all, I tested with Builder and NoArgsContructor, same behavior.
I also tried with fork=true
and compilerArgs
that worked in JDK 9 (contained in the pom.xml inside mentioned project).
Can someone create java-10.sh
in https://github.com/rzwitserloot/lombok/tree/master/docker/provision/jdk to speed up the development process?
And possibly add a pom file, similar to the one in https://github.com/rzwitserloot/lombok/tree/master/docker/maven/files/jdk-9
I doubt it'll work, but (tip from ##java's Maldivia): if we add to lombok's manifest:
Add-Exports: module/package=ALL-UNNAMED
the javac version "10-ea" doesn't match VERSION_PARSER
in Javac.java
Similar, the "JDK10" enum name in Sources doesn't match the SOURCE_PARSER
pattern.
Meaning it falls back to version 6, so it ends up looking for TypeTags instead of TypeTag.
We've improved the version parsing. This might have fixed the TypeTags problem.
Can you test this using the edge release?
We still need to have a look at the __
trick.
@rspilker Tried edge release and I get same error (the only difference is lack of "WARNING" for LombockProcessor:
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ lombok-jdk10 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/dev/moje/lombok-jdk10/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
symbol: method setBar(java.lang.String)
location: class com.kirela.lombok.Foo
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.955 s
[INFO] Finished at: 2018-02-07T20:06:48+01:00
[INFO] Final Memory: 16M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project lombok-jdk10: Compilation failure
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
[ERROR] symbol: method setBar(java.lang.String)
[ERROR] location: class com.kirela.lombok.Foo
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The edge release is worked for me with maven build of my project.
But it does not work with IntelliJ build.
Warning:(35, 8) java: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM extends com.sun.tools.javac.main.DelegatingJavaFileManager implements javax.tools.StandardJavaFileManager
at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:148)
at lombok.javac.apt.InterceptingJavaFileManager.<init>(InterceptingJavaFileManager.java:40)
at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:165)
(...snip...)
I think we need to add "com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM" to
LombokFileObjects.KNOWN_JAVA9_FILE_MANAGERS.
Is there any way to use 'edge' release with Maven without installing hte jar locally, that is some kind of snapshots repository ?
Are you planning a release which supports JDK10 ?
thank you
Have you got any idea why my example project (https://github.com/krzyk/lombok-jdk10-example) doesn't work with Lombok edge release and JDK 10?
It looks really simple so there are no issues from other libraries for sure there.
Have the same problem with Gradle build. When do you plan to release new version?
related to #524 ?
Building lombok itself on jdk10 didn't work because ecj isn't really compatible with it, but, hey, managed to work around it.
lombok itself on jdk10 seems to work fine for me; that's with javac on the command line.
Gonna integrate @tmurakam excellent work on this and push out an edge release.
@rzwitserloot I tested the newest edge release and I get following error in my work project, building using maven:
[WARNING] /home/key/validator/CollectionSizeValidator.java:[7,8] lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM extends com.sun.tools.javac.main.DelegatingJavaFileManager implements javax.tools.StandardJavaFileManager
at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:148)
at lombok.javac.apt.InterceptingJavaFileManager.<init>(InterceptingJavaFileManager.java:40)
at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:165)
at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:87)
at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:87)
at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:140)
at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:69)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:674)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:771)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:866)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(JavacProcessingEnvironment.java:110)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1202)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1311)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1250)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:928)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1075)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
While when I create my own lombok build from #1620 project compiles fine with Java 10.
So it looks like there are some changes between the #1620 and the commits that got into edge release.
And when I do the same on my java 10 test project (https://github.com/krzyk/lombok-jdk10-example) I get error for edge release:
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ lombok-jdk10 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/dev/moje/lombok-jdk10/target/classes
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs
WARNING: Please consider reporting this to the maintainers of lombok.javac.apt.LombokProcessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
symbol: method setBar(java.lang.String)
location: class com.kirela.lombok.Foo
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.151 s
[INFO] Finished at: 2018-03-30T10:31:18+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project lombok-jdk10: Compilation failure
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
[ERROR] symbol: method setBar(java.lang.String)
[ERROR] location: class com.kirela.lombok.Foo
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
And the build from #1620 works fine (with no warnings about illegal reflective access)
Needed for: BeneStem/arch-playground-spring#13
Works for me with edge version (does NOT work for 1.6.20):
Gradle 4.5.1
OpenJDK Runtime Environment 18.3 (build 10+46)
IntelliJ 2018.1.1RC
Ubuntu 17.10
I tried edge version of lombok and netbeans dev version. And I see the following error.
INFO [com.sun.tools.javac.processing.JavacProcessingEnvironment]: Annotation processing error:
java.lang.NoSuchFieldException: NE
at java.lang.Class.getField(Class.java:1703)
at lombok.javac.JavacTreeMaker$SchroedingerType.getFieldCached(JavacTreeMaker.java:156)
at lombok.javac.JavacTreeMaker$TreeTag.treeTag(JavacTreeMaker.java:292)
at lombok.javac.Javac.(Javac.java:171)
Caused: java.lang.ExceptionInInitializerError
at lombok.javac.handlers.HandleGetter.(HandleGetter.java:303)
Hello, Any update when this would work for Java 10? Tried the edge, got this error but the build was successful
java.lang.IllegalArgumentException: Problems in URI 'file://lombok/dummy/ForceNewRound0.java' (file://lombok/dummy/ForceNewRound0.java)
at lombok.javac.apt.LombokFileObjects$Java9Compiler.toPath(LombokFileObjects.java:187)
at lombok.javac.apt.LombokFileObjects$Java9Compiler.wrap(LombokFileObjects.java:172)
at lombok.javac.apt.LombokFileObjects.createEmpty(LombokFileObjects.java:157)
at lombok.javac.apt.InterceptingJavaFileManager.getJavaFileForOutput(InterceptingJavaFileManager.java:47)
at jdk.compiler/com.sun.tools.javac.processing.JavacFiler.createSourceOrClassFile(JavacFiler.java:500)
at jdk.compiler/com.sun.tools.javac.processing.JavacFiler.createSourceFile(JavacFiler.java:426)
at lombok.javac.apt.LombokProcessor.forceNewRound(LombokProcessor.java:365)
at lombok.javac.apt.LombokProcessor.process(LombokProcessor.java:352)
at lombok.core.AnnotationProcessor$JavacDescriptor.process(AnnotationProcessor.java:115)
at lombok.core.AnnotationProcessor.process(AnnotationProcessor.java:165)
at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.process(AnnotationProcessor.java:99)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:964)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:881)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(JavacProcessingEnvironment.java:110)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1202)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1311)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1250)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:928)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:50)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:36)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:98)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:51)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:156)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:141)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:114)
at jdk.internal.reflect.GeneratedMethodAccessor410.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:596)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.IllegalArgumentException: URI has an authority component
at java.base/sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:53)
at java.base/sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:99)
at java.base/java.nio.file.Paths.get(Paths.java:138)
at lombok.javac.apt.LombokFileObjects$Java9Compiler.toPath(LombokFileObjects.java:185)
... 78 more
warning: Can't force a new processing round. Lombok won't work.```
I tried with the edge version and it somehow works but not the way I would expect it.
What I mean is that the class files are generated and despite one exception being thrown durring compile time:
Problems in URI 'file://lombok/dummy/ForceNewRound0.java' (file://lombok/dummy/ForceNewRound0.java)
it seems ok but the Jackson annotations are not generated. I found some hints that I should require in module file java.desktop plus set in lombok.properties lombok.anyConstructor.addConstructorProperties but that did not help.
Anyone know how to make lombok generate the annotations?
@LukaszTheProgrammer in my project setting lombok.anyConstructor.addConstructorProperties=true
is enough.
@BeneStem have you specified anything else? How does lombok knows where to look for config file ?
@LukaszTheProgrammer we are kind of spamming in this issue...
You need to put a file called lombok.config
in the root of the project folder or in the classpath.
For me project root is working.
Thanks, sorry for the spam :)
I have the same issue like @LukaszTheProgrammer after updating to the edge version:
Problems in URI 'file://lombok/dummy/ForceNewRound0.java' (file://lombok/dummy/ForceNewRound0.java)
Adding lombok.anyConstructor.addConstructorProperties=true didn't really help
IllegalArgumentException: URI has an authority component
We will have a new edge release with a fix for that.
@rspilker Tested with JDK10 and JDK11 (using maven docker image maven:3-jdk-10-slim
and maven:3-jdk-11-slim
).
Work like charm (and without adding any <compilerArgs>
just basic configuration), even with mapstruct
.
I tested on previous edge (two days ago) I got issue but now seems to be ok
the new edge works for me with jdk10
How can i use the edge version with maven?
Worked with:
<plugin> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> <executions> <execution> <phase>validate</phase> <goals> <goal>install-file</goal> </goals> <configuration> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <packaging>jar</packaging> <file>${project.basedir}/../lib/lombok-edge.jar</file> </configuration> </execution> </executions> </plugin>
Waiting for the new lombok release to support JDK 10.
BTW, a version RC.X or Snapshot to be used inside maven could be very helpfull
Is there any indication when this version will be released?
Thanks.
Also interested, what the estimate for release in maven central?
Use https://jitpack.io , and specify the commit hash or the tag in the version of the dependency management tool like maven and jitpack will build the library and add the dependency to your project.
I totally forget to use it in this case ! Thanks @suyambuganesh ๐
Which commit should we target for this ?
Tried to use snapshot on jitpack.io, but the build has failed
https://jitpack.io/com/github/rzwitserloot/lombok/-v1.16.20-ga9aafe2-112/build.log
The log is quite clear:
BUILD FAILED
/home/jitpack/build/build.xml:176: To compile lombok, you need JDK9 or higher; lombok requires this version because it's rather difficult to produce lombok builds that are compatible on JDK9 without at least building with JDK9. Sorry about that.
Yes, it's clear, but can anybody explain how to use Java 9 on Jitpack.io? The first way is to add jitpack.yml to the repository and specify java version in this file but I think it's not our case
I had no luck with jitpack even after adding a jitpack.yml
file and telling it to use java 9 - I've never used ant and have no idea why its java version check fails.
However there's a neat trick where you can get gradle to download dependencies from arbitrary urls by setting them up as ivy repos, like this:
repositories {
//this is what we want to download: https://projectlombok.org/lombok-edge.jar
ivy {
url 'https://projectlombok.org/'
layout 'pattern', {
artifact '/[artifact].[ext]'
}
}
}
dependencies {
compileOnly name: 'lombok-edge'
annotationProcessor name: 'lombok-edge'
}
This may lead to not reproducible builds, so please take appropriate care.
Addendum: This assumes that you are not using the gradle-lombok plugin. Instead, you need to apply the apt plugin, example for IDEA:
plugins {
id 'net.ltgt.apt-idea' version '0.15'
}
See https://projectlombok.org/setup/gradle for more info about using lombok directly without the gradle-lombok plugin.
mvn install:install-file -Dfile=lombok-edge.jar -DgroupId=org.projectlombok -DartifactId=lombok -Dversion=lombok-edge.UNRELEASED -Dpackaging=jar
Installing the jar manually with a custom version that will never be released is elegant (you can use lombok-edge.UNRELEASED
in any local project after running the above command).
Replacing a publicly released version with an alpha version is just asking for trouble, it's neither elegant, nor a good advice.
Yeah, this is better way.
I have researched every doc, issue, and SO answer I can find, and I am still unable to use Gradle + Lombok + JDK 10 + module-info.java. Could someone please take a look at this simple repro and tell me whether the problem is me or Lombok? I think I have included all the necessary code and info someone would need.
Is there a road map somewhere that might indicate when it is planned for a public GA maven central release of Lombok would support Java 10?
@davidgoate, You may want to respond to this thread: https://groups.google.com/d/msg/project-lombok/J0kguXyDUB8/prEfHN0qAgAJ
We expect to release 1.16.22 within a few hours with full jdk10 support.
@rspilker it works, awesome thank you.
@krzyk, I think, that this issue can be finally closed :)
I'm still getting this error with JDK 10 and Lombok 1.16.22 with maven:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building matrix-bridge-java 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ matrix-bridge-java ---
[INFO] Deleting /home/alejzeis/IdeaProjects/matrix-bridge-java/target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ matrix-bridge-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ matrix-bridge-java ---
[WARNING] ********************************************************************************************************************
[WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *
[WARNING] ********************************************************************************************************************
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /home/alejzeis/IdeaProjects/matrix-bridge-java/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[29,32] cannot find symbol
symbol: method getLogger()
location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
[ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[30,32] cannot find symbol
symbol: method getLogger()
location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.826 s
[INFO] Finished at: 2018-05-29T22:11:26-05:00
[INFO] Final Memory: 21M/74M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project matrix-bridge-java: Compilation failure: Compilation failure:
[ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[29,32] cannot find symbol
[ERROR] symbol: method getLogger()
[ERROR] location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
[ERROR] /home/alejzeis/IdeaProjects/matrix-bridge-java/src/main/java/io/github/jython234/matrix/bridge/MatrixBridgeEventHandler.java:[30,32] cannot find symbol
[ERROR] symbol: method getLogger()
[ERROR] location: variable bridge of type io.github.jython234.matrix.bridge.MatrixBridge
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I don't understand why this is happening, as the 1.16.22 version should support java 10. I also have included the requires static lombok;
in my module-info.java. Am I doing something wrong here?
EDIT: code can be found here: https://github.com/jython234/matrix-bridge-java
Looks like lombok won't work with modularized projects? If I delete my module-info.java file with no other changes everything magically works. Could someone correct me on this?
Yeah. I can confirm that Lombok 1.16.22 has a problem with modularized projects and Java 10. If I use a module-info.java
and Java 10 in my project, Lombok is doing nothing during the (maven) build. This results in a failed build, because all the getters, setters, constructers, builders, etc. are missing.
Lombok is literally the last blocker that is holding me back from using the Java 9 module feature.
I guess It is the maven compiler plugin.
Maybe you have to ask on maven mailing list
I've added Lombok to the annotationProcessorPaths
in the maven-compiler-plugin
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
// [...]
</annotationProcessorPaths>
// [...]
</configuration>
</plugin>
As a result, the Lombok annotation processor is invoked again. But now I get this error:
/lombok/dummy/ForceNewRound0.java:[1,1] file should be on source path, or on patch path for module
Couldn't get the lastest release of Lombok working with JDK 10 on STS 3.9.4
I can also confirm that with modularized projects the build fails on JDK10 using Lombok 1.6.22.
I get this error when compiling with maven:
Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile failed.: IllegalArgumentException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project nl.mavi.warriorofmars.model: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init> (Unknown Source)
at org.objectweb.asm.ClassReader.<init> (Unknown Source)
at org.objectweb.asm.ClassReader.<init> (Unknown Source)
at org.codehaus.plexus.languages.java.jpms.AsmModuleInfoParser.parse (AsmModuleInfoParser.java:80)
at org.codehaus.plexus.languages.java.jpms.AsmModuleInfoParser.getModuleDescriptor (AsmModuleInfoParser.java:65)
at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths (LocationManager.java:113)
at org.apache.maven.plugin.compiler.CompilerMojo.preparePaths (CompilerMojo.java:219)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:762)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
FWIW, my project compiles when I bump the version from 1.16.20
to 1.18.0
.
My project still does not compile with version 1.18.0
After upgrade to Gradle 4.9 my project failed to compile.
JDK 10.0.1
Lombok 1.18.0
warning: 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 jdk.compiler/com.sun.tools.javac.processing.JavacFiler
public class ExceptionHandler {
^
at lombok.javac.apt.LombokProcessor.getJavacFiler(LombokProcessor.java:447)
at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:90)
at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:112)
at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:165)
Gradle 4.9
OpenJDK 10.0.2
Lombok 1.18.0
-->Exception getJavacFiler
(related: io.franzbecker.gradle-lombok 1.14 --> java.lang.ExceptionInInitializerError)
When I put Lombok on processor-module-path and module-path to compile my simple hello world modular project https://github.com/bottemav/hello-world-lombok-modular I get no compile errors or warnings but also no class files! The project contains only a class with a data annotation and I use the command line for compilation.
Oracle or OpenJdk 10.0.2
Lombok 1.18.0 or edge release
The JDK 11-ea compiler gives me a clue why it doesn't generate class files:
Module lombok does not read a module that exports org.mapstruct.ap.spi
If I remove provides org.mapstruct.ap.spi.AstModifyingAnnotationProcessor with lombok.launch.AnnotationProcessorHider.AstModificationNotifier;
from Lombok's module-info.java
, then I can compile my little project and despite a FilerException, the class file is generated with getters and setters.
I had the error, then I added this per the webpage:
Maven 3.5.4
Java 9.0.4
It failed until I added the version and scope tags (when I used the spring creator it only had )
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
We are facing this problem as well.
Java 10.0.1
Maven 3.5.3
lombok-maven-plugin 1.18.0.0
lombok (dependency) - edge
I am using lombok-maven-plugin to generate sources (default configuration - sources are taken from the main/lombok location).
Lombok does not generate getter and setter methods, which result in the compilation error - cannot find symbol
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/tomasz.zieleniewski/Desktop/tmp/lombok-examples/src/main/java/com/intive/Main.java:[14,16] cannot find symbol
symbol: method setUrl(java.lang.String)
location: variable company of type com.intive.Company
[ERROR] /C:/Users/tomasz.zieleniewski/Desktop/tmp/lombok-examples/src/main/java/com/intive/Main.java:[15,35] cannot find symbol
symbol: method getUrl()
location: variable company of type com.intive.Company
Lombok source
package com.intive;
import lombok.Data;
@Data
public class Company {
private String url;
}
pom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<failOnWarning>true</failOnWarning>
<release>10</release>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<source>10</source>
<target>10</target>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.0.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>edge</version>
<scope>provided</scope>
</dependency>
</dependencies>
try latest edge (1.18.3) but same problem.
Only the FilerException is gone. (see #1808)
@krzyk @tzieleniewski Any luck compiling successfully lombok with Java 10.
I am using edge version,
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>edge</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/lombok-edge.jar</systemPath>
@arushi315 nope, I tried to run Lombok from the command line and still not working. Sources are only copied to the generated directory. I did it for a modular JAR. When my artifact is not modular then Lombok works.
> java --module-path modules --add-modules org.mapstruct.processor --module lombok/lombok.launch.Main delombok src -d src-gen
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by lombok.javac.JavacTreeMaker$TypeTag to method com.sun.tools.javac.code.Type.getTag()
WARNING: Please consider reporting this to the maintainers of lombok.javac.JavacTreeMaker$TypeTag
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
C:\Users\tomasz.zieleniewski\Desktop\tmp\lombok-examples\src\main\java\module-info.java:3: error: module not found: lombok
requires static lombok;
^
C:\Users\tomasz.zieleniewski\Desktop\tmp\lombok-examples\src\main\lombok\com\intive\Company.java:8: error: package lombok does not exist
import lombok.Data;
^
C:\Users\tomasz.zieleniewski\Desktop\tmp\lombok-examples\src\main\lombok\com\intive\Company.java:10: error: cannot find symbol
@Data
^
symbol: class Data
where the modules directory contains
- lombok-edge.jar
- mapstruct-processor-1.2.0.Final.jar
@tzieleniewski Thank you for the quick response.
with JDK 10 you will get following error:
[loading /modules/java.base/java/lang/Deprecated.class]
[loading /modules/java.base/java/lang/annotation/Target.class]
[loading /modules/java.base/java/lang/annotation/ElementType.class]
[loading /modules/java.base/java/lang/annotation/Retention.class]
[loading /modules/java.base/java/lang/annotation/RetentionPolicy.class]
[loading /modules/java.base/java/lang/annotation/Annotation.class]
Round 1:
input files: {com.intive.Main, com.intive.Company}
annotations: [lombok.Data]
last round: false
[search path for source files: \repo\org\mapstruct\mapstruct-processor\1.2.0.Final\mapstruct-processor-1.2.0.Final.jar,.]
[search path for class files: \repo\org\mapstruct\mapstruct-processor\1.2.0.Final\mapstruct-processor-1.2.0.Final.jar,.]
Processor lombok.launch.AnnotationProcessorHider$AnnotationProcessor matches [lombok/lombok.Data] and returns true.
[parsing started lombok.javac.apt.EmptyLombokFileObject@4285cbaa]
[parsing completed 7ms]
[loading /modules/java.base/java/lang/SuppressWarnings.class]
[loading /modules/java.base/java/lang/Override.class]
Round 2:
input files: {}
annotations: []
last round: true
/lombok/dummy/ForceNewRound0.java:1: error: file should be on source path, or on patch path for module
[total 1230ms]
1 error
see also #1723
may it's a lombok-maven-plugin problem.
If you remove the plugin and and add following, the processors will be called but ends with the ForceNewRound0.java error
<compilerArgs>
<arg>--processor-module-path</arg>
<arg>\repo\org\projectlombok\lombok\${org.projectlombok.version}\lombok-${org.projectlombok.version}.jar;P:\Maven Repository\repo\org\mapstruct\mapstruct-processor\1.2.0.Final\mapstruct-processor-1.2.0.Final.jar;</arg>
<arg>-verbose</arg>
<arg>-XprintRounds</arg>
<arg>-XprintProcessorInfo</arg>
<arg>-Xlint</arg>
<arg>-J-verbose</arg>
</compilerArgs>
Sample found here: https://github.com/MCMicS/lombok-examples/blob/15772-without-lombok-maven/pom.xml
Still occurs with latest Edge Release
I posted a fix for this issue using Gradle at: https://stackoverflow.com/questions/55227728/cannot-find-symbol-error-lombok-1-18-6-does-not-work-with-gradle-5-2-1-jdk-10
Thanks.
Seems to work with 1.18.8
.
just try it with Java version 1.8 and also with lombok version 1.16.18.. It should work out.
What happening behind is that lombok is a getter setter for java and sometimes that is not compatible for versions or u need to setup the versions manually so just try for these verisons it must work out
Thx~~ 1.18.8 nice
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.576 s
[INFO] Finished at: 2020-03-07T21:32:36+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project MLP178: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
@Paromita23 I'm not sure that's actually relevant to this particular issue. If you're still running into this with lombok 1.18.12, open a new bug report, do use the -e/-X switches (because without an actual stack trace or a test project to reproduce this error, it's not possible for us to fix it, of course), and include a test project so we can reproduce it.
@Paromita23 I think this is not a issue related to lombok version or your jdk version. So you must raise the issue or give the exact versions you are using for this project.
at least 2-years BUG 8-)
...that 2 seconds, what should be saved with lombok take aprox 2 year for many-many-many developers to fix it! ๐
Nice job! ๐ฏ ๐คฃ
use this
<dependency>
<groupId>org.jboss.openjdk-orb</groupId>
<artifactId>openjdk-orb</artifactId>
<version>8.1.1.Final</version>
</dependency>