I am writing a spring-mvc app (and learning spring-mvc). I didn't add servlet dependency to pom.xml. When I run mvn compile
or mvn package
, it finishes succesfully. Isn't it suppose to throw exception like 'can not find javax.servlet.http.HttpServlet'? How does it compile?
mvn dependency:list:
The following files have been resolved: [INFO]
aopalliance:aopalliance:jar:1.0:compile [INFO]
commons-dbcp:commons-dbcp:jar:1.4:compile [INFO]
commons-pool:commons-pool:jar:1.5.4:compile [INFO]
log4j:log4j:jar:1.2.17:compile [INFO]
org.codehaus.jackson:jackson-core-asl:jar:1.9.12:compile [INFO]
org.codehaus.jackson:jackson-mapper-asl:jar:1.9.12:compile [INFO]
org.slf4j:jcl-over-slf4j:jar:1.7.2:compile [INFO]
org.slf4j:slf4j-api:jar:1.7.2:compile [INFO]
org.slf4j:slf4j-log4j12:jar:1.7.2:compile [INFO]
org.springframework:spring-aop:jar:3.2.1.RELEASE:compile [INFO]
org.springframework:spring-beans:jar:3.2.1.RELEASE:compile [INFO]
org.springframework:spring-context:jar:3.2.1.RELEASE:compile [INFO]
org.springframework:spring-core:jar:3.2.1.RELEASE:compile [INFO]
org.springframework:spring-expression:jar:3.2.1.RELEASE:compile [INFO] org.springframework:spring-jdbc:jar:3.2.1.RELEASE:compile [INFO]
org.springframework:spring-tx:jar:3.2.1.RELEASE:compile [INFO]
org.springframework:spring-web:jar:3.2.1.RELEASE:compile [INFO]
org.springframework:spring-webmvc:jar:3.2.1.RELEASE:compile [INFO]
postgresql:postgresql:jar:9.2-1002.jdbc4:compile