Solve jar package dependencies: Spring IO platform launches bom

Glossary: 
​​BOM (bill of materials): Bill of materials, a good way to resolve jar package dependencies.

Spring IO Platform

Origin: Spring only focused on ioc and aop at first, but now it has developed into a huge system. Such as security, mvc and so on. In this way, when different modules are integrated or externally integrated, their respective version numbers are required for dependency processing. For example, the newer spring and the older quartz, they will encounter problems in integration, which will bring inconvenience to the construction and upgrade. Therefore, Spring IO Platform came into being. As long as it is introduced in the project, the dependencies do not need a version number during external integration. The original text of the official website is as follows: "when you do declare a dependency on something that's part of the Platform, you will now be able to omit the version number." For 
example:

<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
    </dependency>
</dependencies>

Spring IO Platform is just a pom file that records the version of spring corresponding to other open source projects. By omitting the version number, it also saves the problem of dealing with dependencies, because there is an optimal version configuration in the Spring IO Platform.

Spring related BOM

Of course, in order to solve these Jar conflicts, SpringSource has launched various BOMs. Of course, the most famous one is spring platform io bom. The three core ones are: spring-framework-bom, spring-boot-dependencies, and platform-bom.

For Spring projects, simply add the following configuration code to the pom.xml file to avoid the problem of managing version conflicts.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>4.2.0.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>1.3.0.M2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>io.spring.platform</groupId>
            <artifactId>platform-bom</artifactId>
            <version>1.1.3.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Reference article

  1. Introduction to spring io platform

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325056298&siteId=291194637