Skip to content

Instantly share code, notes, and snippets.

@CoderInOne
Created May 7, 2019 04:23
Show Gist options
  • Save CoderInOne/5896aed23ad2c1269ddd66ab4fb32a33 to your computer and use it in GitHub Desktop.
Save CoderInOne/5896aed23ad2c1269ddd66ab4fb32a33 to your computer and use it in GitHub Desktop.
Differences between dependencyManagement and dependencies in Maven

https://stackoverflow.com/questions/2619598/differences-between-dependencymanagement-and-dependencies-in-maven

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-server</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>   <!-- 方便统一管理父子工程的版本等等 -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment