weixin_39788051
weixin_39788051
2020-11-22 21:07

master分支下直接执行mvn clean install会报错

报错信息如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project tracer-core: Compilation failure [ERROR] Annotation generator had thrown the exception. java.lang.NoClassDefFoundError: javax/annotation/Generated [ERROR] at org.openjdk.jmh.generators.core.BenchmarkGenerator.generateImport(BenchmarkGenerator.java:601) [ERROR] at org.openjdk.jmh.generators.core.BenchmarkGenerator.generateClass(BenchmarkGenerator.java:559) [ERROR] at org.openjdk.jmh.generators.core.BenchmarkGenerator.generate(BenchmarkGenerator.java:120) [ERROR] at org.openjdk.jmh.generators.BenchmarkProcessor.process(BenchmarkProcessor.java:58) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:964) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:881) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(JavacProcessingEnvironment.java:110) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1202) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1311) [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1250) [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:928) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90) [ERROR] at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126) [ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169) [ERROR] at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785) [ERROR] at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:152) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [ERROR] Caused by: java.lang.ClassNotFoundException: javax.annotation.Generated [ERROR] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466) [ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566) [ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) [ERROR] ... 41 more

该提问来源于开源项目:sofastack/sofa-tracer

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39788051 weixin_39788051 5月前

    image

    点赞 评论 复制链接分享
  • weixin_39714528 weixin_39714528 5月前

    请问你是用 Java 9 来编译的吗?

    点赞 评论 复制链接分享
  • weixin_39788051 weixin_39788051 5月前

    嗯,用java10编译的,现在用java8编译没问题了

    点赞 评论 复制链接分享
  • weixin_39714528 weixin_39714528 5月前

    嗯,目前 Java 9 和 Java 10 是没法编译的。这个 issue 我先关掉了,有问题可以你可以再开这个 issue。

    点赞 评论 复制链接分享
  • weixin_39788051 weixin_39788051 5月前

    好的,谢谢!!!

    点赞 评论 复制链接分享