当前位置:网站首页>Groupid(artifact id)
Groupid(artifact id)
2022-07-31 14:24:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
什么是groupid和artifactId?
groupid和artifactId被统称为“坐标”是为了保证项目唯一性而提出的,如果你要把你项目弄到maven本地仓库去,你想要找到你的项目就必须根据这两个id去查找。 groupId和artifactId是maven管理项目包时用作区分的字段,就像是地图上的坐标。 artifactId:artifactId一般是项目名或者模块名。 groupId:groupId分为几个字段,例如cn.com.fullstack,前面的com叫【域】,后面的是你自己起的域名。 groupId一般分为多个段,这里我只说两段,第一段为域,第二段为公司名称。域又分为org、com、cn等等许多,其中org为非营利组织,com为商业组织。举个apache公司的tomcat项目例子:这个项目的groupId是org.apache,它的域是org(因为tomcat是非营利项目),公司名称是apache,artigactId是tomcat。
【作用】
一般来说,包名根目录=groupId+artifactId。这个是不允许和别人重复的,尤其是需要上线的项目。一般公司为了不重复都会注册一个域名(URL用的那种),这样就肯定不会重复了。
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> springboot项目创建必须继承父类
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent> GAV坐标
<groupId>com.offcn</groupId>
<artifactId>springbootdemo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springbootdemo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies> springboot必须有的两个依赖
<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>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--lombok依赖代替实体类中方法的 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
</dependency>
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128455.html原文链接:https://javaforall.cn
边栏推荐
- [QNX Hypervisor 2.2 User Manual]9.14 safety
- LeetCode·每日一题·1161.最大层内元素和·层次遍历
- LeetCode旋转数组
- Linux bash: redis-server: 未找到命令
- CodeIgniter 打开错误日志
- 组合系列--有排列就有组合
- Tortoise speed by "template"
- C language basic practice (nine-nine multiplication table) and printing different asterisk patterns
- Sentinel安装与部署
- Analysis of the startup source code of hyperf (2) - how the request reaches the controller
猜你喜欢
The 232-layer 3D flash memory chip is here: the single-chip capacity is 2TB, and the transmission speed is increased by 50%
“听我说谢谢你”还能用古诗来说?清华搞了个“据意查句”神器,一键搜索你想要的名言警句...
Asynchronous processing business using CompletableFuture
Five dimensions to start MySQL optimization
Unity Shader入门精要学习——透明效果
AWS implements scheduled tasks - Lambda+EventBridge
The Selenium IDE of the Selenium test automation
Analysis of the startup source code of hyperf (2) - how the request reaches the controller
技能大赛训练题:交换机的远程管理
OAuth2:使用JWT令牌
随机推荐
技能大赛训练题: 子网掩码划分案例
The Selenium IDE of the Selenium test automation
Detailed guide to compare two tables using natural full join in SQL
深度剖析 Apache EventMesh 云原生分布式事件驱动架构
线程池的使用二
Asynchronous processing business using CompletableFuture
Unity学习笔记 关于AVPro视频跳转功能(Seeking)的说明
Controller层代码这么写,简洁又优雅!
[Blue Bridge Cup Trial Question 46] Scratch Magnet Game Children's Programming Scratch Blue Bridge Cup Trial Question Explanation
[Pytorch] torch.argmax() usage
OAuth2:单点登陆客户端
Shell script classic case: backup of files
技能大赛训练题:交换机虚拟化练习
一篇文章讲清楚!数据库和数据仓库到底有什么区别和联系?
IDEA connects to MySQL database and uses data
redhat/openssl生成自签ca证书并使用
技能大赛训练题:MS15_034漏洞验证与安全加固
动作捕捉系统用于柔性机械臂的末端定位控制
Description of Hikvision camera streaming RTSP address rules
1-hour live broadcast recruitment order: industry leaders share dry goods, and enterprise registration is open丨qubit · point of view