IT Certificaions

Google Cloud Platform

Wednesday, December 10, 2014

Maven :: Include servlet-api only at local maven install not during building war

Include  servlet-api  only at local maven install not during building war
Add scope element with value as ‘Provided’. Now maven will not include this jar in lib whiling

building war file so that you can deploy it on tomcat.

 <dependency>
 <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

For all scopes in maven, please visit http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope