现在开始用Maven,感觉一切都是很新鲜,不过刚入手,一切都是不知道原理.
我们运行Maven项目的时候,一般会用到两个命令,Maven build OR Maven Install.下面我们来看看这个两个命令的结果是怎么样的.
1,我们运行 Maven Install.
结果呢:
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building framework 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ framework --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\flashcow\workspacegoogle\framework\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ framework --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ framework --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\flashcow\workspacegoogle\framework\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ framework --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.10:test (default-test) @ framework --- [INFO] Surefire report directory: D:\flashcow\workspacegoogle\framework\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running cn.haohaowo.framework.AppTest Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE! Results : Failed tests: testApp(cn.haohaowo.framework.AppTest) Tests run: 1, Failures: 1, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.328s [INFO] Finished at: Fri May 10 10:56:46 CST 2013 [INFO] Final Memory: 4M/8M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project framework: There are test failures. [ERROR] [ERROR] Please refer to D:\flashcow\workspacegoogle\framework\target\surefire-reports for the individual test results. [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竟然报错了,不过我们仔细一看的报错的,地方竟然是说执行TEST没有通过,所以才报错呀.
------------------------------------------------------- T E S T S ------------------------------------------------------- Running cn.haohaowo.framework.AppTest Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE! Results : Failed tests: testApp(cn.haohaowo.framework.AppTest) Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
2,我们来运行 Maven Build.
我们Run一下看下结果.就没有TEST过程,所以他不会提示错误.
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building framework 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ framework --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\flashcow\workspacegoogle\framework\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ framework --- [INFO] Nothing to compile - all classes are up to date [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.750s [INFO] Finished at: Fri May 10 11:16:29 CST 2013 [INFO] Final Memory: 3M/7M [INFO] ------------------------------------------------------------------------