当前位置:网站首页>pom容易忽略的问题
pom容易忽略的问题
2022-07-25 07:41:00 【秃头侠客】
distributionManagement: 配置管理 用于打包
mvn install 会将项目生成的构件安装到本地Maven仓库,
mvn deploy 用来将项目生成的构件分发到远程Maven仓库。
本地Maven仓库的构件只能供当前用户使用,在分发到远程Maven仓库之后,所有能访问该仓库的用户都能使用你的构件。
我们需要配置POM的distributionManagement来指定Maven分发构件的位置,如下:<project> ... <distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>http://127.0.0.1:8080/nexus/content/repositories/releases/</url> </repository> <!-- 镜像仓库 --> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://127.0.0.1:8080/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> ... </project>dependencyManagement: 管理Maven依赖
一般父模块配置,子模块通过继承或插入的方式导入依赖。
请参考此篇文章 依赖管理基础配置
<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> <!-- 公司或者组织的唯一标志,并且配置时生成的路径也是由此生成, 如com.companyname.project-group,maven会将该项目打成的jar包放本地路径:/com/companyname/project-group --> <groupId>com.companyname.project-group</groupId> <!-- 项目的唯一ID,一个groupId下面可能多个项目,就是靠artifactId来区分的 --> <artifactId>project</artifactId> <!-- 版本号 --> <version>1.0</version> </project>
详情看此篇文章 [Maven POM](https://www.runoob.com/maven/maven-pom.html)
边栏推荐
- Summer Challenge harmonyos - slider slider for custom components
- The application of for loop and if judgment statement
- Oracle19采用自动内存管理,AWR报告显示SGA、PGA设置的过小了?
- Have you got the advanced usage of pytest?
- Analysis of difficulties in diagramscene project
- 关于GBase 自动关闭连接问题
- 【Unity入门计划】基本概念-预制件 Prefab
- How does uxdb extract hours, minutes and seconds from date values?
- [unity introduction program] basic concepts GameObject & components
- P1048 [NOIP2005 普及组 T3] 采药
猜你喜欢
![[unity introduction program] basic concepts GameObject & components](/img/fc/7e0a6f057394a6fd4409a7bf518ba5.png)
[unity introduction program] basic concepts GameObject & components

【Unity入门计划】基本概念-2D碰撞体Collider 2D

Nailing the latest version, how to clear the login phone number history data

Have you got the advanced usage of pytest?

Beijing internal promotion | Microsoft STCA recruits nlp/ir/dl research interns (remote)

Teach you to use cann to convert photos into cartoon style

Leetcode (Sword finger offer) - 04. search in two-dimensional array

A domestic open source redis visualization tool that is super easy to use, with a high-value UI, which is really fragrant!!

使用CycleGAN训练自己制作的数据集,通俗教程,快速上手

How to reverse a stack with recursive functions and stack operations only
随机推荐
整数a按位取反(~)后的值为-(a+1)
How does MTK change the boot logo?
Use cyclegan to train self-made data sets, popular tutorials, and get started quickly
ACNet:用于图像超分的非对称卷积(附实现code)
Analysis of common classes of Servlet
MathWorks has been in China for 15 years. What are the secrets of continuous innovation?
Summer Challenge harmonyos - slider slider for custom components
10 key points and 5 measures for good project management
轮询、中断、DMA和通道
【程序员2公务员】一、基本认知
[software testing] package resume from these points to improve the pass rate
What has become a difficult problem for most people to change careers, so why do many people study software testing?
Calculation formula of cross entropy
Huawei wireless device configuration wpa2-802.1x-aes security policy
冰冰学习笔记:类与对象(上)
【程序员2公务员】四、常见问题
Kubernetes monitoring component metrics server deployment
【ES6】函数的参数、Symbol数据类型、迭代器与生成器
Oracle19 adopts automatic memory management. The AWR report shows that the settings of SGA and PGA are too small?
Xinku online | cnopendata shareholder information data of A-share listed companies