spring-petclinic/spring-petclinic-microservices

Issue with Lombok dependency

shobhakamath opened this issue · 3 comments

When I build using the command ./mvnw clean install -P buildDocker
I get the following error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project spring-petclinic-vets-service: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'

arey commented

Hi @shobhakamath
How did you know that this issue is coming from Lombok?
Do you have a full stacktrace?

Hi @arey

Please see the full stack trace:
Caused by: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'
at lombok.javac.JavacImportList.getFullyQualifiedNameForSimpleNameNoAliasing (JavacImportList.java:53)
at lombok.core.TypeResolver.typeRefToFullyQualifiedName (TypeResolver.java:60)
at lombok.javac.HandlerLibrary.handleAnnotation (HandlerLibrary.java:247)
at lombok.javac.JavacTransformer$AnnotationVisitor.visitAnnotationOnType (JavacTransformer.java:79)
at lombok.javac.JavacNode.traverse (JavacNode.java:132)
at lombok.javac.JavacAST.traverseChildren (JavacAST.java:223)
at lombok.javac.JavacNode.traverse (JavacNode.java:95)
at lombok.javac.JavacAST.traverseChildren (JavacAST.java:223)
at lombok.javac.JavacNode.traverse (JavacNode.java:90)
at lombok.javac.JavacAST.traverse (JavacAST.java:219)
at lombok.javac.JavacTransformer.transform (JavacTransformer.java:63)
at lombok.javac.apt.LombokProcessor.process (LombokProcessor.java:324)
at lombok.core.AnnotationProcessor$JavacDescriptor.process (AnnotationProcessor.java:187)
at lombok.core.AnnotationProcessor.process (AnnotationProcessor.java:241)
at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.process (AnnotationProcessor.java:90)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor (JavacProcessingEnvironment.java:1021)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:937)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1265)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1380)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1271)
at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:948)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:104)
at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper (JavacTaskImpl.java:152)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:94)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:136)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:182)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1209)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:198)
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:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
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 jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)

The issue gets resolved with this small fix:
shobhakamath@cff5ba5

Please refer the issue shown below:
projectlombok/lombok#3393

arey commented

Fixed with #245