1. 程式人生 > >pom.xml依賴與tomcate的servlet-api衝突

pom.xml依賴與tomcate的servlet-api衝突

在pom.xml中新增依賴

		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>javax.servlet-api</artifactId>
    			<version>3.1.0</version>
    		</dependency>

tomcat啟動後報錯: 嚴重: The web application [/mywebapp] registered the JBDC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. 解決:dependency中新增:

<scope>provided</scope>

作用是,限制該依賴只在編譯和測試的時候用,這樣在tomcat啟動時就不會產生衝突。