[ERROR] Failure executing javac, but could not parse the error: [ERROR] java

本文介绍了Maven在打包过程中遇到的编译异常问题及解决方案,包括调整内存配置与设置正确的编码格式。
maven 打包编译异常
Compilation failure
Failure executing javac, but could not parse the error:
编译器 (1.6.0_21) 中出现异常。
java.nio.BufferOverflowException
解决方案:
1、设置内存占用大小:MAVEN_OPTS=-Xmx512m。
2、设置编译编码
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<!-- 增加字符编码,[color=red]要与项目编码一致[/color] -->
<encoding>UTF-8</encoding>
</configuration>
</plugin>

可能原因是由于字符集不统一,使用GBK、UTF-8或者UTF-16导致使用多字节存放字符,内存使用增加,堆(heap)的尺寸无法提供程序所需的空间,造成异常。更深入的分析还在进行中。
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default-compile) on project dcloud-common: Compilation failure [ERROR] Failure executing javac, but could not parse the error: [ERROR] [ERROR] [ERROR] An annotation processor threw an uncaught exception. [ERROR] Consult the following stack trace for details. [ERROR] java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' [ERROR] at lombok.javac.JavacImportList.getFullyQualifiedNameForSimpleNameNoAliasing(JavacImportList.java:53) [ERROR] at lombok.core.TypeResolver.typeRefToFullyQualifiedName(TypeResolver.java:60) [ERROR] at lombok.javac.HandlerLibrary.handleAnnotation(HandlerLibrary.java:247) [ERROR] at lombok.javac.JavacTransformer$AnnotationVisitor.visitAnnotationOnType(JavacTransformer.java:79) [ERROR] at lombok.javac.JavacNode.traverse(JavacNode.java:132) [ERROR] at lombok.javac.JavacAST.traverseChildren(JavacAST.java:223) [ERROR] at lombok.javac.JavacNode.traverse(JavacNode.java:95) [ERROR] at lombok.javac.JavacAST.traverseChildren(JavacAST.java:223) [ERROR] at lombok.javac.JavacNode.traverse(JavacNode.java:90) [ERROR] at lombok.javac.JavacAST.traverse(JavacAST.java:219) [ERROR] at lombok.javac.JavacTransformer.transform(JavacTransformer.java:63) [ERROR] at lombok.javac.apt.LombokProcessor.process(LombokProcessor.java:324) [ERROR] at lombok.core.AnnotationProcessor$JavacDescriptor.process(AnnotationProcessor.java:187) [ERROR] at lombok.core.AnnotationProcessor.process(AnnotationProcessor.java:241) [ERROR] at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.process(AnnotationProcessor.java:90) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Unknown Source) [ERROR] at jdk.compiler/com.sun.tools.javac.Main.compile(Unknown Source) [ERROR] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) [ERROR] at java.base/java.lang.reflect.Method.invoke(Unknown Source) [ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:484) [ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:155) [ERROR] at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:575) [ERROR] at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:116) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162) [ERROR] at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173) [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101) [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906) [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283) [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:206) [ERROR] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) [ERROR] at java.base/java.lang.reflect.Method.invoke(Unknown Source) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:255) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:201) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:361) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:314) [ERROR] [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 Build step 'Execute shell' marked build as failure Finished: FAILURE
09-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值