Maven依赖spring-web vs spring-webmvc [英] Maven dependency spring-web vs spring-webmvc
问题描述
以下依赖项之间有什么区别?
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>
如果仅我包含spring-webmvc
,则会隐式添加spring-web
.
If I include spring-webmvc
alone then spring-web
is implicitly added.
我们什么时候应该单独使用spring-web
?
When should we use spring-web
alone?
推荐答案
spring-web
提供了核心的HTTP集成,包括一些便捷的Servlet过滤器,Spring HTTP Invoker,可与其他Web框架和HTTP技术集成的基础架构.粗麻布黑森州.
spring-web
provides 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-webmvc
是Spring MVC的实现. spring-webmvc
取决于放在spring-web
上,因此包含它会传递地添加spring-web
.您不必显式添加spring-web
.
spring-webmvc
is an implementation of Spring MVC. spring-webmvc
depends on on spring-web
, thus including it will transitively add spring-web
. You don't have to add spring-web
explicitly.
如果您不使用Spring MVC,但想利用Spring支持的其他与Web相关的技术,则应该仅依赖spring-web
.
You should depend only on spring-web
if you don't use Spring MVC but want to take advantage of other web-related technologies that Spring supports.
这篇关于Maven依赖spring-web vs spring-webmvc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!