2016-10-08 73 views
0

試圖在Ubuntu16.04上安裝Mahout,我有成功安裝maven 3.3.9和subversion 1.9.3。新象夫和Maven,我不知道我是否應該跳過測試,只需使用未能執行目標org.apache.maven.plugins:maven-surefire-plugin:2.16:測試(默認測試)項目mahout-math:有測試失敗

mvn -DskipTests 

這是我得到的錯誤:org.apache.maven:

[INFO] Mahout Build Tools ................................. SUCCESS [ 6.621 s] 
[INFO] Apache Mahout ...................................... SUCCESS [ 1.164 s] 
[INFO] Mahout Math ........................................ FAILURE [03:35 min] 
[INFO] Mahout MapReduce Legacy ............................ SKIPPED 
[INFO] Mahout Integration ................................. SKIPPED 
[INFO] Mahout Examples .................................... SKIPPED 
[INFO] Mahout Release Package ............................. SKIPPED 
[INFO] Mahout Math/Scala wrappers ......................... SKIPPED 
[INFO] Mahout Spark bindings .............................. SKIPPED 
[INFO] Mahout Spark bindings shell ........................ SKIPPED 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 03:44 min 
[INFO] Finished at: 2016-10-07T19:05:02-07:00 
[INFO] Final Memory: 33M/134M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven- 
surefire-plugin:2.16:test (default-test) on project mahout-math: There are test failures. 
[ERROR] 
[ERROR] Please refer to/home/flora/.linuxbrew/Cellar/mahout/trunk/math/target/surefire-reports 
for the individual test results. 
[ERROR] -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project mahout-math: There are test failures. 

Please refer to /home/flora/.linuxbrew/Cellar/mahout/trunk/math/target/surefire-reports for the individual test results. 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 

所致。 plugin.MojoFailureException:有測試失敗。

Please refer to /home/flora/.linuxbrew/Cellar/mahout/trunk/math/target/surefire-reports for the individual test results. 
at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82) 
at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:190) 
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:852) 
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:720) 
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 
... 20 more 
[ERROR] 
[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 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 
[ERROR] mvn <goals> -rf :mahout-math 
+0

具有測試失敗。你必須決定,如果你喜歡用這個...當然你也可以使用'-DskipTests'跳過測試失敗的簽出源的版本? – khmarbaise

回答

0

我使用Maven 3.3.9,但我不能只用「MVN -DskipTests」,它會失敗,因爲缺乏生命週期階段或目標。這裏是錯誤信息:

[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1] 

有兩種方法可以忽略單元測試的失敗。使用階段安裝例如:方法

method 1: mvn -DskipTests install 

method 2: mvn -Dmaven.test.skip=true install 

的區別兩者是前者將編譯單元測試,而後者不會,因此後者可以跳過編譯失敗,前者不能。

Maven Surefire Plugin: Skipping Tests

相關問題