<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.</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.</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-</project.build.sourceEncoding>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-</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.</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.</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.</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.</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.</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
</plugins> </build>
</project>

如上代码:

首先 系统要先从

(1) <dependencies> 强制引用

(2)</dependencyManagement> 强制引用

(3)然后是 <parent> 里面 强制引用找;

(4)如果实在是没有了,就从  dependencies 的间接引用 找;

比如在 dependency 里面有:

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

而:

core里面有:

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
那么 fastjson 属于间接引用;会在第四部执行; 如果我想要制定fastjson的版本直接在dependencyManagement里面指定:
    <dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.6.</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.</version>
</dependency>
</dependencies>
</dependencyManagement>

这样,dependency里面所有的 有引用 fastjson 的地方全部变成了:1.2.58

mvn pom文件引用顺序关系的更多相关文章

  1. dcm4che-core导包失败! mvn pom文件导包总是失败

    原因可能是所导的包不在共有项目中,可能在个人项目中,需要添加远程仓库 <!--远程仓库部署--><repositories> <repository> <id ...

  2. maven 依赖显示红线 pom文件不显示红线的一种可能问题

    pom文件引用的是CDH的jar包 而没有配置CDH的仓库 导致maven找不到资源  ,依赖显示红色波浪,并且在仓库内生成了一堆.lastupdate文件 解决: 1. 删除本地仓库内所有的.las ...

  3. 【maven】架包下载失败,maven引入架包失败,pom文件未报错,但是引用的注解找不到

    出现这种问题 看到这个jar包显示是unkown,不知道版本,所以这样的解决方法就是 1.先查看maven设置是使用的自定义的仓库还是默认的仓库 2.删除掉你引用的jar包下载失败的文件夹 3.然后重 ...

  4. Maven项目中在properties 中使用 ${} 来引用pom文件中的属性

    比如在pom文件中定义了属性如下: <jdbc.host.global>127.0.0.1</jdbc.host.global> <jdbc.databasename.g ...

  5. CoreException: Could not get the value for parameter compilerId for plugin execution default-compile Maven项目pom文件报错,插件引用不到

    CoreException: Could not get the value for parameter compilerId for plugin execution default-compile ...

  6. Maven pom文件常用配置,转载

    什么是POM Project Object Model,项目对象模型.通过xml格式保存的pom.xml文件.作用类似ant的build.xml文件,功能更强大.该文件用于管理:源代码.配置文件.开发 ...

  7. maven pom文件

    setting.xml主要用于配置maven的运行环境等一系列通用的属性,是全局级别的配置文件:而pom.xml主要描述了项目的maven坐标,依赖关系,开发者需要遵循的规则,缺陷管理系统,组织和li ...

  8. maven pom文件详解

    http://www.blogjava.net/hellxoul/archive/2013/05/16/399345.html http://blog.csdn.net/houpengfei111/a ...

  9. Apache Maven pom文件

    Welcome to Apache Maven Apache Maven is a software project management and comprehension tool. Based ...

随机推荐

  1. AngularJS $http用法总结

    最近由于项目需要,在研究AngularJS $http的用法,查了很多资料,发现貌似没有一篇内容可以完整的满足我对$http的基本了解,为了下次方便自己查找,所以特意把最近查到的一些资料和自己的理解记 ...

  2. security Alternative forms secuerity

    security Alternative forms secuerity (mostly obsolete) English Alternative forms secuerity Pronuncia ...

  3. 证券secuerity经济术语

    证券按其性质不同,证券可以分为证据证券.凭证证券和有价证券三大类.证据证券只是单纯地证明一种事实的书面证明文件,如信用证.证据.提单等:凭证证券是指认定持证人是某种私权的合法权利者和持证人纪行的义务有 ...

  4. .net core jenkins持续集成

    执行 Shell pwd ls echo ${PATH} whoami which dotnet dotnet --info dotnet --version echo '============== ...

  5. Nginx 配置文件nginx.conf中文详解

    ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_ ...

  6. Kali Linux 2019.4发布了!解决Kali Linux 2019.4中文乱码问题

    2019年11月26日,kali Linux官网发布了Kali Linux 2019.4发行版,此版本做了很大的改动,界面焕然一新. Kali Linux 2019.4涉及到的一些新更新内容包括: 新 ...

  7. 22.centos7基础学习与积累-008-系统调优及安全设置

    从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 1.关闭selinux功能: SELinux(Securety-EnhancedLi ...

  8. Java中线程池,你真的会用吗?ExecutorService ThreadPoolExcutor

    原文:https://www.hollischuang.com/archives/2888 在<深入源码分析Java线程池的实现原理>这篇文章中,我们介绍过了Java中线程池的常见用法以及 ...

  9. C++——STL(算法)

    以下对所有算法进行细致分类并标明功能:<一>查找算法(13个):判断容器中是否包含某个值adjacent_find:   在iterator对标识元素范围内,查找一对相邻重复元素,找到则返 ...

  10. python笔记36-装饰器之wraps

    前言 前面一篇对python装饰器有了初步的了解了,但是还不够完美,领导看了后又提出了新的需求,希望运行的日志能显示出具体运行的哪个函数. __name__和doc __name__用于获取函数的名称 ...