maven#dependencyManagement

dependencyManagement for version management, do not download the actual jar package.

If a package is declared in dependencyManagement in, then in the pom <dependencies> <dependency> next node will not have some version number.

 

  <! - here will really download jar package, the corresponding version of the jar will go dependencyManagement to look for, can not be found on the error, or we need to write in the following Version ->    
 < the Dependencies > 
        < dependency > 
            < the groupId > org.springframework.cloud </ the groupId > 
            < the artifactId > Spring-Cloud-Starter-alibaba-nacos-Discovery </ the artifactId > 
        </ dependency >

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

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

    <! - dependent version definition, just a statement here, if you use the jar, I will use the version provided here -> 
    < dependencyManagement > 
        < the Dependencies > 
            < dependency > 
                < groupId > org.springframework.cloud </ groupId > 
                < the artifactId > Spring-Cloud-Dependencies </ the artifactId > 
                < Version > Greenwich.RELEASE </ Version > 
                < type > POM </ type > 
                < scope > Import </scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>0.2.1.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

 

Guess you like

Origin www.cnblogs.com/luohaonan/p/12385943.html