错误:Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2

错误:Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2

转发:https://blog.csdn.net/sz15732624895/article/details/82151055

报错信息:

  1. [INFO] ------------------------------------------------------------------------

  2. [INFO] Reactor Summary:

  3. [INFO]

  4. [INFO] e3-manager ......................................... SUCCESS [ 1.286 s]

  5. [INFO] e3-manager-pojo .................................... SUCCESS [ 0.676 s]

  6. [INFO] e3-manager-dao ..................................... SUCCESS [ 0.168 s]

  7. [INFO] e3-manager-interface ............................... SUCCESS [ 0.113 s]

  8. [INFO] e3-manager-service ................................. SUCCESS [ 0.152 s]

  9. [INFO] e3-manager-web ..................................... FAILURE [ 1.496 s]

  10. [INFO] ------------------------------------------------------------------------

  11. [INFO] BUILD FAILURE

  12. [INFO] ------------------------------------------------------------------------

  13. [INFO] Total time: 4.345 s

  14. [INFO] Finished at: 2018-08-28T14:08:53+08:00

  15. [INFO] Final Memory: 18M/207M

  16. [INFO] ------------------------------------------------------------------------

  17. [ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project e3-manager-web: Could not start Tomcat: Failed to start component [StandardServer[-1]]: Failed to start component [StandardService[Tomcat]]: Failed to start component [StandardEngine[Tomcat]]: A child container failed during start -> [Help 1]

  18. [ERROR]

  19. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

  20. [ERROR] Re-run Maven using the -X switch to enable full debug logging.

  21. [ERROR]

  22. [ERROR] For more information about the errors and possible solutions, please read the following articles:

  23. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

  24. [ERROR]

  25. [ERROR] After correcting the problems, you can resume the build with the command

  26. [ERROR] mvn <goals> -rf :e3-manager-web

显示的错误信息:找不到Tomcat,打开Tomcat失败。

查询过程:本项目是在manager里面的pom.xml内配置的Tomcat插件:

 
  1. <!-- 配置tomcat插件 -->

  2. <build>

  3. <plugins>

  4. <plugin>

  5. <groupId>org.apache.tomcat.maven</groupId>

  6. <artifactId>tomcat7-maven-plugin</artifactId>

  7. <configuration>

  8. <path>/</path>

  9. <port>8080</port>

  10. </configuration>

  11. </plugin>

  12. </plugins>

  13. </build>

而manager的Tomcat是引用的parent里面的pom.xml内配置的Tomcat插件:

 
  1. <!-- 配置Tomcat插件 -->

  2. <plugin>

  3. <groupId>org.apache.tomcat.maven</groupId>

  4. <artifactId>tomcat7-maven-plugin</artifactId>

  5. <version>2.2</version>

  6. </plugin>

原因:是jdk版本的问题,Tomcat7默认使用的jdk是jdk1.7。我原来配置的是1.8,所以一直报错。

后来在 windows-preference-java-Installed JREs 里面配置jdk版本为1.7,项目运行成功。

项目运行成功:

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值