使用GWT + maven(gwt-maven-plugin)创建项目会编译以下错误,正常的GWT项目创建(没有maven)编译良好(luna,GWT sdk2.6)

时间:2014-10-09 18:48:17

标签: gwt eclipse-juno eclipse-luna gwt-maven-plugin

这是项目编译时的例外,环境是ubuntu 14.01LTS, ECLIPSE LUNA,也是日食Juno,gwt-eclipse-plugin,Java 1.7,

但是当我在没有maven项目的情况下创建它时,它编译得很好(新项目 - > google gwt)

Loading inherited module 'com.***.***.Application'
   Loading inherited module 'com.google.gwt.user.User'
      Loading inherited module 'com.google.gwt.core.Core'
     Loading inherited module 'com.google.gwt.core.CompilerParameters'
        [WARN] Setting configuration property named compiler.max.vars.per.var in com.google.gwt.core.CompilerParameters that has not been previously defined.  This may be disallowed in the future.
Compiling module com.***.***.Application
[ERROR] Unexpected internal compiler error
java.lang.ArrayIndexOutOfBoundsException: 0
    at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.writeEnumValueOfMethod(GwtAstBuilder.java:2839)
    at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.processEnumType(GwtAstBuilder.java:2488)
    at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1921)
    at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1604)
    at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1441)
    at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1311)
    at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3131)
    at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:127)
    at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:346)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470)
    at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:880)
    at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:284)
    at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:511)
    at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:434)
    at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:420)
    at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:485)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:241)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:223)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:139)
    at com.google.gwt.dev.Compiler.run(Compiler.java:167)
    at com.google.gwt.dev.Compiler.run(Compiler.java:132)
    at com.google.gwt.dev.Compiler$1.run(Compiler.java:99)
    at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
    at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
    at com.google.gwt.dev.Compiler.main(Compiler.java:106)

请告诉我这是什么原因, 提前致谢! Thangaraj

2 个答案:

答案 0 :(得分:0)

不确定Maven,但尝试删除2 gwt-unitCache目录并再次尝试编译

enter image description here

答案 1 :(得分:0)

我遇到了同样的错误,似乎是因为我没有明确添加

<inherits name="com.google.gwt.user.User"/>

到我的GWT模块xml