You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i run mvn clean compile with the current setup, no Test_GsonTypeAdapter is created.
I deep dive into the issue by debugging via mvnDebug clean compile and found out that com.google.auto.value.processor.AutoValueProcessor.init(ProcessingEnvironment) throws the following error:
[AutoValueExtensionsException] An exception occurred while looking for AutoValue extensions. No extensions will function.java.lang.NoClassDefFoundError: com.squareup.javapoet.TypeName
at java.base/java.lang.J9VMInternals.prepareClassImpl(Native Method)
at java.base/java.lang.J9VMInternals.prepare(J9VMInternals.java:341)
at java.base/java.lang.Class.getConstructor(Class.java:669)
at com.google.auto.value.processor.SimpleServiceLoader.load(SimpleServiceLoader.java:73)
at com.google.auto.value.processor.SimpleServiceLoader.load(SimpleServiceLoader.java:49)
at com.google.auto.value.processor.AutoValueProcessor.extensionsFromLoader(AutoValueProcessor.java:105)
at com.google.auto.value.processor.AutoValueProcessor.init(AutoValueProcessor.java:115)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:686)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:786)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:881)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1222)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1335)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1258)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:936)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
at com.sun.tools.javac.api.JavacTaskImpl$$Lambda$136/0x0000000000000000.call(Unknown Source)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
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:1134)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:187)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
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:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
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:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: java.lang.ClassNotFoundException: com.squareup.javapoet.TypeName
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:605)
at java.base/java.lang.ClassLoader.loadClassHelper(ClassLoader.java:1185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1100)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1083)
... 45 more
Not very familiar with using maven, seems your build is not resolving dependencies. This works fine in basically every Gradle project so not sure there's anything we can do here. Seems you'll need to troubleshoot your build issue
I experienced an issue with the maven configuration of auto-value-gson-extension using @GenerateTypeAdapter.
Please see my demo Repository here: https://github.com/mseele/auto-value-gson-test
When i run
mvn clean compile
with the current setup, noTest_GsonTypeAdapter
is created.I deep dive into the issue by debugging via
mvnDebug clean compile
and found out thatcom.google.auto.value.processor.AutoValueProcessor.init(ProcessingEnvironment)
throws the following error:(but unfortunately is not output in the console)
Adding
to the
<annotationProcessorPaths>
triggers the next exception (now visible on the console):Fatal error compiling: java.lang.NoClassDefFoundError: com.ryanharter.auto.value.gson.GenerateTypeAdapter
After adding
everything works.
Please see https://github.com/mseele/auto-value-gson-test/blob/master/pom.xml. The current version triggers the error. I've commented out the two items that need to be there to make it work.
The text was updated successfully, but these errors were encountered: