【问题标题】:gwt-maven-plugin: Compile fails "with status 1"gwt-maven-plugin:编译失败“状态为 1”
【发布时间】:2014-07-23 00:19:16
【问题描述】:

我从事 GWT 项目已经有一段时间了,我相信自从我添加了新的依赖项后,我得到了以下错误。

未能在项目项目上执行目标 org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile(默认):命令 [[

/bin/sh -c /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java -Xmx512m -classpath /home/user/git/project/target/project-0.0.1- SNAPSHOT/WEB-INF/classes:/home/user/.m2/repository/A.jar:/home/user/.m2/repository/B.jar:... 更多的依赖项 ... com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war /home/user/git/project/target/project-0.0.1-SNAPSHOT -localWorkers 1 -XfragmentCount -1 -sourceLevel 1.6 -gen /home/user/git/project/target/.generated my.project.Project

  1. 当我在 Windows 7 上运行错误中给出的命令时,我得到“输入太长”。
  2. 当我在 Ubuntu 上运行命令时,没有显示错误。 echo $? 但显示返回状态为 1。

mvn package -X 给出的堆栈跟踪看起来像

在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 在 org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 在 org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 在 org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 在 org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 在 org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 在 org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 在 org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:606) 在 org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) 在 org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 在 org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 在 org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

引起:org.codehaus.mojo.gwt.shell.ForkedProcessExecutionException:命令[[ /bin/sh -c /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java -Xmx512m -classpath /home/user/git/project/target/project-0.0.1-SNAPSHOT/WEB -INF/classes:/home/user/.m2/repository/A.jar:/home/user/.m2/repository/B.jar:... 更多依赖项 ... com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war /home/user/git/project/target/project-0.0.1-SNAPSHOT -localWorkers 1 -XfragmentCount -1 -sourceLevel 1.6 -gen /home/用户/git/project/target/.generated my.project.Project ]] 失败,状态为 1 在 org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo$JavaCommand.execute(AbstractGwtShellMojo.java:485) 在 org.codehaus.mojo.gwt.shell.CompileMojo.compile(CompileMojo.java:446) 在 org.codehaus.mojo.gwt.shell.CompileMojo.doExecute(CompileMojo.java:351) 在 org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:172) 在 org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 更多

mvn package 输出看起来像

[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ project ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ project ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:exploded (default) @ project ---
[INFO] Exploding webapp
[INFO] Assembling webapp [project] in [/home/user/git/project/target/project-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/user/git/project/src/main/webapp]
[INFO] Webapp assembled in [475 msecs]
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ project ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ project ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ project ---
[INFO] Surefire report directory: /home/user/git/project/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- gwt-maven-plugin:2.6.0:compile (default) @ project ---
[INFO] auto discovered modules [my.module.Module, my.project.Project]
[INFO] my.module.Module has no EntryPoint - compilation skipped
[INFO] Compiling module my.project.Project
[INFO]    Validating units:
[INFO]       Ignored 115 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]    Computing all possible rebind results for 'com.google.gwt.useragent.client.UserAgentAsserter'
[INFO]       Rebinding com.google.gwt.useragent.client.UserAgentAsserter
[INFO]          Checking rule <generate-with class='com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryGenerator'/>
[INFO]             [WARN] Unknown type 'com.google.web.bindery.requestfactory.shared.RequestFactory' specified in deferred binding rule
[INFO]          Checking rule <generate-with class='com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryEditorDriverGenerator'/>
[INFO]             [WARN] Unknown type 'com.google.web.bindery.requestfactory.gwt.client.RequestFactoryEditorDriver' specified in deferred binding rule
[INFO]          Checking rule <generate-with class='com.google.gwt.editor.rebind.SimpleBeanEditorDriverGenerator'/>
[INFO]             [WARN] Detected warnings related to 'com.google.gwt.editor.client.SimpleBeanEditorDriver'.   Are validation-api-<version>.jar and validation-api-<version>-sources.jar on the classpath?
[INFO]             Specify -logLevel DEBUG to see all errors.
[INFO]             [WARN] Unknown type 'com.google.gwt.editor.client.SimpleBeanEditorDriver' specified in deferred binding rule
[INFO]       Rebinding com.google.gwt.useragent.client.UserAgentAsserter
[INFO]          Checking rule <generate-with class='com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryGenerator'/>
[INFO]             [WARN] Unknown type 'com.google.web.bindery.requestfactory.shared.RequestFactory' specified in deferred binding rule
[INFO]          Checking rule <generate-with class='com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryEditorDriverGenerator'/>
[INFO]             [WARN] Unknown type 'com.google.web.bindery.requestfactory.gwt.client.RequestFactoryEditorDriver' specified in deferred binding rule
[INFO]       Rebinding com.google.gwt.useragent.client.UserAgentAsserter
[INFO]          Checking rule <generate-with class='com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryGenerator'/>
[INFO]             [WARN] Unknown type 'com.google.web.bindery.requestfactory.shared.RequestFactory' specified in deferred binding rule
[INFO]          Checking rule <generate-with class='com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryEditorDriverGenerator'/>
[INFO]             [WARN] Unknown type 'com.google.web.bindery.requestfactory.gwt.client.RequestFactoryEditorDriver' specified in deferred binding rule

... Lots of Rebinding similar to above...

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30.074s
[INFO] Finished at: Tue Jun 03 09:18:19 MST 2014
[INFO] Final Memory: 17M/436M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.0:compile (default) on project project: Command [[
[ERROR] /usr/bin/java -Xmx512m -classpath *long classpath* com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war /home/user/git/project/target/project-0.0.1-SNAPSHOT -localWorkers 8 -XfragmentCount -1 -sourceLevel 1.6 -gen /home/user/git/project/target/.generated my.project.Project
[ERROR] ]] failed with status 1

【问题讨论】:

  • GWT 编译器前面的输出/日志中真的没有输出吗? (一般在成功构建或失败的模块总结之前)
  • 我通过运行mvn package 更新了 eclispe 控制台中显示的输出。这有帮助吗?我也弄错了:在 ubuntu 上,该命令也返回 1,尽管我在它的输出中没有发现明显的错误。

标签: maven gwt dependencies command-line-arguments gwt-maven-plugin


【解决方案1】:

我跑了 mvn package -X 发现如下错误

[INFO] [ERROR] Errors in 'gwtupload/client/DecoratedFileUpload.java' [INFO] [ERROR] Line 371: Rebind result 'gwtupload.client.DecoratedFileUpload.DecoratedFileUploadImpl' cannot be abstract

所以我将依赖项 gwtupload 更新为解决了我的问题的新版本。

我在之前的尝试中忽略了这个错误的原因是 mvn package 之前成功了,在这个特定版本中使用了这个依赖项。所以我想这个错误一定一直存在,仍然导致打包成功。

【讨论】:

  • 感谢 maven 的 Debug 标志建议,我们遇到了类似的 gwt 错误,遗憾的是最终异常没有正确的错误
【解决方案2】:

当 MVN 在 Cygwyn 32 位版本中构建 Vaadin 项目时,我遇到了类似的问题。但是当我切换到 Cygwyn 64 位时,这个问题就解决了。

[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:7.7.2:compile (default) on project vaadin-app: Command [[
...
[ERROR] ]] failed with status 1
[ERROR] -> [Help 1]
...
failed with status 1
        at org.codehaus.mojo.gwt.shell.CompileMojo.compile(CompileMojo.java:582)
        at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute(CompileMojo.java:435)
        at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:182)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-18
    • 2018-12-27
    • 2017-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-31
    相关资源
    最近更新 更多