当前位置:网站首页>Dependencymanagement and dependencies
Dependencymanagement and dependencies
2022-06-10 23:08:00 【Li_ XiaoJin】
DependencyManagement and Dependencies
Maven Use dependencyManagement Element to provide a way to manage dependent version numbers .
Usually at the top of an organization or project POM see dependencyManagement Elements .
Use pom.xml Medium dependencyManagement Element allows all to reference a dependency in a subproject without explicitly listing the version amount .
Maven Will go up the father and son level , Until you find someone who has dependencyManagement Elements of the project , And then it will use this dependencyManagement The version number specified in the element .
<dependencyManagement>
<dependencies>
<dependency>
<groupId>mysq1</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.2</version>
</dependency>
<dependencies>
</dependencyManagement>
Then you can add... In the sub project mysql-connector You can not specify the version number , for example :
<dependencies>
<dependency>
<groupId>mysq1</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
The advantage of doing so is : If multiple subprojects refer to the same dependency , You can avoid declaring a version number in each used subproject , So when you want to upgrade or switch to another version , Just update in the top-level parent container , It doesn't need to be modified one by one ; In addition, if a subproject needs another version , Just declare version Can be .
dependencyManagement It's just a statement of dependency , No introduction , So the child project needs to display the required dependencies for the declaration .
If you don't declare dependencies in subprojects , Is not inherited from the parent project ; Only the dependency is written in the subproject , And no specific version was specified , Will inherit the item from the parent project , also version and scope Read from parent pom. If the version number is specified in the subproject , Then you will use the... Specified in the subproject jar edition .
Copyright: use Creative Commons signature 4.0 International license agreement to license Links:https://lixj.fun/archives/dependencymanagement-dependencies
边栏推荐
- AI智能视频分析EasyCVR平台设备通道批量删除功能的开发实现
- 聚簇索引和非聚簇索引
- 线程池——治理线程的法宝
- 数据与信息资源共享平台(九)
- Interpreting the registry class of mmcv
- Sdn/nfv application in cloud data center
- 200个C语言单词,请收藏!
- Icml2022 | reexamine end-to-end voice to text translation from scratch
- Blue Bridge Cup_ A fool sends a letter_ recursion
- Operation of simulated examination platform for welder (primary) test questions in 2022
猜你喜欢

UE4骨骼动画新手入门

UE4 getting started with bone animation

数据与信息资源共享平台(七)

Html+php+mysql login registration page

Keras deep learning practice (8) -- using data enhancement to improve neural network performance

AI智能视频分析EasyCVR平台设备通道批量删除功能的开发实现

样板小作坊

200 c language words, please collect!

2022 t elevator repair test question simulation test question bank and online simulation test

How Photoshop opens, edits and exports pictures in webp format
随机推荐
IP anti query domain name
数据与信息资源共享平台(八)
Vscode common shortcuts
样板小作坊
Vulnhub practice DC-1 target
Use of cocoeval function
我们对产业互联网的认识,还是困囿于互联网式的平台和中心的逻辑之中
How Photoshop opens, edits and exports pictures in webp format
视频融合云服务EasyCVR集群录像事件查询无效是什么原因?
200个C语言单词,请收藏!
Multus CNI deployment and basic use of kubernetes multi network card scheme
ICML2022 | 從零開始重新審視端到端的語音到文本翻譯
数学与素质教育
【sql语句基础】——增(insert)
How to run Plink software -- three methods
Sherri Monroe was appointed as the new executive director of the additive manufacturers green trade association
Auto.js pro 开发环境配置
Operation of simulated examination platform for welder (primary) test questions in 2022
DC2 of vulnhub
爬虫学习知识