官方git:https://github.com/spring-projects/greenhouse
按照姿势来:
第一步:
git clone git://github.com/SpringSource/greenhouse.git
第二部:
这里省略CD 因为IDEA 在当前项目打开终端是默认在 greenhouse 目录的
mvn clean install
然后 喜闻乐见的 报错
官方Demo中的pom.xml
<org.aspectj-version>1.8.9</org.aspectj-version>
这个版本改一下,不然报错
改完之后 mvn clean install
继续报错如下:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project greenhouse: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/vvan/IdeaProjects/greenhouse/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
解决方法 :
一是命令行,
1 |
|
二是写入pom文件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
这里采用在idea 的 Terminal 中 敲第一个命令 然后如下结果
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.708 s
[INFO] Finished at: 2018-09-09T10:28:33+08:00
[INFO] ------------------------------------------------------------------------
注意:这里直接Terminal按照官方姿势跑
mvn t7:run
http://localhost:8080/greenhouse
,会报一个500错误 还没研究
换成tomcat 发布 :
就直接上去了