step4----->往工程中添加Spring的子项目spring IO Platform------->通过maven添加相关框架(pom.xml)

添加Spring IO Platform的目的:

  避免自己的project的外部依赖(external dependencies)之间产生版本冲突问题。更多详细信息参见:Spring IO Platform概述

具体操作步骤:

  step1,往自己的工程中添加Spring IO Platform

      • 编写project的pom.xml,添加如下代码,引入Spring IO Platform
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>io.spring.platform</groupId>
                    <artifactId>platform-bom</artifactId>
                    <version>Athens-SR1</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>    
 

  step2,使用Spring IO Platform

      • 引入了Spring IO Platform之后,后面再往project中引入external dependencies的时候,可以不用管external dependencies的版本,譬如要引入spring-core这个external dependency,只需要按照如下方式编写pom.xml即可,不用填写<version>标签的值

         

      • 注意,不引入Spring IO Platform的情况下,如果按照上图配置pom.xml,maven会自动查找Spring-core的最新版本集成到你的project,但是引入了Spring IO Platform的情况下,maven则会集成Spring IO Platform表格中所定义的Spring-core的相应版本到你的project中,不管Spring-core有多少可用版本,最新版本是什么,maven都不会理会,它只会遵照Spring IO Platform表格中定义的版本去构建你的工程

 

      

posted on 2016-12-17 22:00  LXRM-JavaWeb、ML  阅读(534)  评论(0编辑  收藏  举报

导航