mvn pom file reference sequence relationship

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sankuai.qcs</groupId>
    <artifactId>qcs-regulation-parent</artifactId>
    <version>1.2.7.1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <parent>
        <groupId>com.meituan.mdp</groupId>
        <artifactId>mdp-parent</artifactId>
        <version>1.2.6</version>
    </parent>

    <scm>
        <url>http://git.sankuai.com/scm/qcs/qcs-regulation-core</url>
        <developerConnection>scm:git:http://git.sankuai.com/scm/qcs/qcs-regulation-core.git</developerConnection>
        <connection>scm:git:http://git.sankuai.com/scm/qcs/qcs-regulation-core.git</connection>
        <tag>v1.2.0</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>meituan-nexus-releases</id>
            <name>Repository for releases artifacts</name>
            <url>http://pixel.sankuai.com/repository/releases</url>
        </repository>
        <snapshotRepository>
            <id>meituan-nexus-snapshots</id>
            <name>Repository for snapshots artifacts</name>
            <url>http://pixel.sankuai.com/repository/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <qcs-regulation-core.version>1.2.8.1-SNAPSHOT</qcs-regulation-core.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-pool2</artifactId>
                <version>2.6.0</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>1.2.58</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.meituan.mdp.boot</groupId>
            <artifactId>mdp-boot-starter-mafka</artifactId>
        </dependency>
        <dependency>
            <groupId>com.meituan.mdp.boot</groupId>
            <artifactId>mdp-boot-starter-log</artifactId>
        </dependency>
        <dependency>
            <groupId>com.meituan.mdp.boot</groupId>
            <artifactId>mdp-boot-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>com.meituan.mdp.boot</groupId>
            <artifactId>mdp-boot-starter-web</artifactId>
            <exclusions>
            <exclusion>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
            </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.meituan.mdp.boot</groupId>
            <artifactId>mdp-boot-starter-squirrel</artifactId>
        </dependency>
        <dependency>
            <groupId>com.meituan.mdp.component</groupId>
            <artifactId>swagger-analysis-core</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-ext</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.sankuai.qcs</groupId>
            <artifactId>qcs-regulation-core</artifactId>
            <version>${qcs-regulation-core.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.meituan.mafka</groupId>
                    <artifactId>mafka-client_2.9</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sankuai.meituan</groupId>
                    <artifactId>mtconfig-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.meituan.log</groupId>
                    <artifactId>scribe-log4j2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.meituan.inf</groupId>
                    <artifactId>xmd-log4j2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-pool2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.jcraft</groupId>
                    <artifactId>jsch</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-java</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <debug>true</debug>
                </configuration>
            </plugin>
            <!--mvn release 版本号-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
            </plugin>
        </plugins>

    </build>
</project>

 

Code above:

 

First, the system must first from 

(1) <dependencies> enforces referential

(2) </ dependencyManagement> enforces referential

(3) then <parent> which enforces referential find;

(4) If it is not, and sought from the indirect reference dependencies;

For example, in dependency there:

<dependency>
            <groupId>com.sankuai.qcs</groupId>
            <artifactId>qcs-regulation-core</artifactId>
            <version>${qcs-regulation-core.version}</version>
         </dependency>  

and:

core inside:


<dependency>
<the groupId> com.alibaba </ the groupId>
<the artifactId> fastjson </ the artifactId>
<Version> fastjson.version $ {} </ Version>
</ dependency>
then fastjson are indirect references; performs a fourth portion ;

Guess you like

Origin www.cnblogs.com/aspirant/p/11122680.html