引入:http://blog.csdn.net/sanzhongguren/article/details/71191290

在spring reference中提到一个解决spring jar包之间版本冲突的解决方案,原文如下

It is possible to accidentally mix different versions of Spring JARs when using Maven. For example, you may find that a third-party library, or another Spring project, pulls in a transitive dependency to an older release. If you forget to explicitly declare a direct dependency yourself, all sorts of unexpected issues can arise.

To overcome such problems Maven supports the concept of a "bill of materials" (BOM) dependency. You can import the spring-framework-bom in yourdependencyManagement section to ensure that all spring dependencies (both direct and transitive) are at the same version.

在配置spring项目依赖时可以通过引入spring-framework-bom避免项目中的spring jar包及关联依赖的三方jar包之间的版本冲突,引入方式:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.1.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

引入后的另一个好处就是在pom文件中引入spring相关依赖时不用再声明<version>属性,以后直接像下边这样声明就可以了:

<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependencies>

PS: Spring官方reference网址 http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/
还有就是最近找到一个翻译reference的网址,虽然没有翻译完整有兴趣的也可以看看 http://spring.cndocs.tk/

最新文章

  1. 题目一:打印出所有的 &quot;水仙花数 &quot;,所谓 &quot;水仙花数 &quot;是指一个三位数,其各位数字立方和等于该数本身。例如:153是一个 &quot;水仙花数 &quot;,因为153=1的三次方+5的三次方+3的三次方。
  2. ifram,framset 互相调用JS
  3. Asphyre 更名pxl 终于全面支持跨平台了.Delphi饭们 激动了吧.
  4. 设置searchBar上右边取消按钮的颜色
  5. SSM-配置文件标签随笔-概要
  6. css布局实践心得总结
  7. jQuery Mobile里xxx怎么用呀? (事件篇)
  8. Linux伙伴系统1
  9. HDU5366 The mook jong (DP)
  10. [转]Mac App distribution in App Store
  11. Android中ViewStub组件使用
  12. [置顶] Hibernate从入门到精通(七)多对一单向关联映射
  13. javascript笔记整理(函数)
  14. ES(二): Build ES Cluster on Azure VM
  15. 微信小程序模板发送,openid获取,以及api.weixin.qq.com不在合法域名内解决方法
  16. css中的注意项,可能会帮助到大家哦!
  17. [BZOJ 2654]tree(陈立杰)
  18. MySQL集群架构:MHA+MySQL-PROXY+LVS实现MySQL集群架构高可用/高性能-技术流ken
  19. Spring Boot 启动(二) 配置详解
  20. [SCOI2014]方伯伯的OJ(线段树)

热门文章

  1. 洛谷 P1098 字符串的展开
  2. ubuntu12.04LTS安装以及卸载 QT4.8.6和QT creator2.5.2
  3. MySQL出现1030-Got error 28 from storage engine错误
  4. CentOS6.8编译安装LAMP
  5. js中去掉字符串中的某个指定字符
  6. Jquery学习小计
  7. java代码----对于数据类型Integer
  8. Java中的 super和this
  9. 第七章 Rolling update
  10. PyQt 5事件和信号