What is the difference between the following dependencies?
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
vs
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
If I include spring-webmvc alone then spring-web is implicitly added.
When should we use spring-web alone?
spring-webprovides core HTTP integration, including some handy Servlet filters, Spring HTTP Invoker, infrastructure to integrate with other web frameworks and HTTP technologies e.g. Hessian, Burlap.spring-webmvcis an implementation of Spring MVC.spring-webmvcdepends on onspring-web, thus including it will transitively addspring-web. You don’t have to addspring-webexplicitly.You should depend only on
spring-webif you don’t use Spring MVC but want to take advantage of other web-related technologies that Spring supports.