详细错误信息:Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project spring-mybatis-2: 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
原因:一般是因为插件问题,可能是插件和maven中的依赖有冲突
解决办法:
针对我的这个问题,主要是因为pom.xml文件中的servlet-api依赖和tomcat插件的依赖有冲突,因此修改一下servlet-api的依赖范围即可
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<!-- 注意此处要限定servlet-api的运行范围,不然会和tomcat插件冲突 -->
<scope>provided</scope>
</dependency>