我从事 GWT 项目已经有一段时间了,我相信自从我添加了新的依赖项后,我得到了下面的错误。
无法在项目项目上执行目标 org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile (default):命令 [[
/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 /.生成 my.project.Project
- 当我在 Windows 7 上运行错误中给出的命令时,我得到“输入太长”。
- 当我在 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.execute(LifecycleStarter.java:161) 在 org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 在 org. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 中的 org.apache.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)。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.apache.maven.cli.MavenCli.main(MavenCli.java:141) 在 sun.reflect 的 org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 执行(MavenCli.java:537) .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.apache.maven.cli.MavenCli.main(MavenCli.java:141) 在 sun.reflect 的 org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 执行(MavenCli.java:537) .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)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) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at 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)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) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at 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)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 )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 )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)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)codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 在 org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)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/user/git/project/target/.generated my.project.Project ]] 在 org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo$JavaCommand.execute(AbstractGwtShellMojo.java:485) 的状态为 1 失败。 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) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at 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