当前位置:网站首页>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
边栏推荐
- A detailed guide to simulating latency with SQL/JDBC
- 纸质说明书秒变3D动画,斯坦福大学吴佳俊最新研究,入选ECCV 2022
- CodeIgniter 打开错误日志
- 以后面试官问你 为啥不建议使用Select *,请你大声回答他!
- Unity学习笔记 关于AVPro视频跳转功能(Seeking)的说明
- The use of thread pool two
- [QNX Hypervisor 2.2用户手册]9.14 safety
- C语言基础练(九九乘法表)与打印不同星号图案
- Small test knife: Go reflection helped me convert Excel to Struct
- Linux bash: redis-server: command not found
猜你喜欢
随机推荐
UnityShader入门学习(三)——Unity的Shader
jOOQ 3.14 released - SQL/XML and SQL/JSON support
龟速乘【模板】
搭建私有的的Nuget包服务器教程
MySQL 23道经典面试吊打面试官
Shell script classic case: backup of files
How to grab configuration information for DELL SC compellent storage system
Shell项目实战1.系统性能分析
UnityShader入门学习(二)——渲染流水线
拥塞控制,CDN,端到端
纸质说明书秒变3D动画,斯坦福大学吴佳俊最新研究,入选ECCV 2022
For enterprises in the digital age, data governance is difficult, but it should be done
I summed up the bad MySQL interview questions
ERROR: Failed building wheel for osgeo
Description of Hikvision camera streaming RTSP address rules
Uniapp WeChat small application reference standard components
对数字化时代的企业来说,数据治理难做,但应该去做
Shang Silicon Valley-JVM-Memory and Garbage Collection (P1~P203)
Why do we need to sub-library and sub-table?
Comparison of Optical Motion Capture and UWB Positioning Technology in Multi-agent Cooperative Control Research









