maven jar包冲突,引起tomcat启动失败

在运行xxl-job的,并使用maven插件启动tomcat时,报了这样一个错,
Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project xxl-job-admin: 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]
原因是项目里引用的servlet api与tomcat里的servlet api冲突了,解决办法如下:


   javax.servlet
   javax.servlet-api
   ${javax.servlet-api.version}
   provided

或者是


   javax.servlet
   javax.servlet-api
   ${javax.servlet-api.version}
   test

在依赖中加入dependency标签中加入scope标签,并明确该依赖只是用作测试

你可能感兴趣的:(maven)