Spring IO Platform学习总结

16 篇文章 0 订阅
2 篇文章 0 订阅

1:Spring IO Platform

Spring IO Plat是一个附带包,不会编译到项目中,它只是将核心Spring API框架内聚集成到一个现代应用程序的平台中。它提供了已经测试完毕能很好协同工作的许多项目的Spring组合版本以及它们的依赖项。你在引入新的Spring IO Platform时不用带版本号的

2:Maven使用Spring IO Platform

  1. 使用pom的形式引入Spring IO Platform
  2. Spring IO Platform官网:https://docs.spring.io/platform/docs/
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.spring.platform</groupId>
                <artifactId>platform-bom</artifactId>
                <version>1.1.2.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
       <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!--pom形式引入,需要加入configuration的executable--!>
                <configuration>
                    <executable>true</executable>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
  1. 使用父依赖的方式引入Spring IO Platform
     <parent>
        <!--
            io.spring.platform bom Brussels-SR7
            springframework version 4.3.13.RELEASE
            spring boot version 1.5.9.RELEASE
        -->
        <groupId>io.spring.platform</groupId>
        <artifactId>platform-bom</artifactId>
        <version>Brussels-SR6</version>
        <relativePath/>
    </parent>
         <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!--parent形式引入,不需要加入configuration的executable--!>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

3:覆盖Spring IO Platform的依赖版本号

<properties>
  <foo.version>1.2.0.RELEASE</foo.version>
</properties>

在使用Spring IO Platform项目的依赖管理时,应根据项目的实际运行环境来合理选择版本号,除非必须,否则不建议修改版本信息。在修改依赖包的版本信息时,可通过IDE点击坐标来查看依赖包对应的属性名。

4:Spring Boot dependency和 Spring Framework

            <!--
                spring boot pom
                spring boot version 1.5.2.RELEASE
                spring boot 项目的集成
            -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!--
                spring framework bom
                spring framework version 4.3.7.RELEASE
                spring framework 集成
            -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring-framework-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

5:总结

Spring IO Platform项目的本质就是一个pom文件,它记录了Spring项目和其它第三方库对应的版本信息。由于Spring IO Platform项目帮助我们做了大量的集成和测试工作,使得我们可以轻松使用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值