Guide to naming conventions on groupId, artifactId and version
groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules, what means that has to be at least as a domain name you control, and you can create as many subgroups as you want. Look at More information about package names.
eg. org.apache.maven, org.apache.commons

A good way to determine the granularity of the groupId is to use the project structure. That is, if the current project is a multiple module project, it should append a new identifier to the parent's groupId.

eg. org.apache.maven, org.apache.maven.plugins, org.apache.maven.reporting

artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed.
eg. maven, commons-math

version if you distribute it then you can choose any typical version with numbers and dots (1.0, 1.1, 1.0.1, ...). Don't use dates as they are usually associated with SNAPSHOT (nightly) builds. If it's a third party artifact, you have to use their version number whatever it is, and as strange as it can look.
eg. 2.0, 2.0.1, 1.3.1

以上内容是maven官网文档中的,命名约定指南(https://maven.apache.org/guides/mini/guide-naming-conventions.html)

总的来说:
groupId:定义当前Maven项目隶属的实际项目,例如org.sonatype.nexus,此id前半部分org.sonatype代表此项目隶属的组织或公司,后部分代表项目的名称,如果此项目多模块话开发的话就子模块可以分为org.sonatype.nexus.plugins和org.sonatype.nexus.utils等。

特别注意的是groupId不应该对应项目隶属的组织或公司,也就是说groupId不能只有org.sonatype而没有nexus。

例如:我建立一个项目,此项目是此后所有项目的一个总的平台,那么groupId应该是org.limingming.projectName,projectName是平台的名称,org.limingming是代表我个人的组织,如果以我所在的浪潮集团来说的话就应该是com.inspur.loushang。

artifactId是构件ID,该元素定义实际项目中的一个Maven项目或者是子模块,如上面官方约定中所说,构建名称必须小写字母,没有其他的特殊字符,推荐使用“实际项目名称-模块名称”的方式定义,例如:spirng-mvn、spring-core等。
推荐格式:使用实际项目名称作为artifactId的前缀,紧接着为模块名称
举例:nexus-indexer、spring-mvc、hibernate-c3po……这些id都是以实际项目名称作为前缀,然后接着一个中划线,再紧跟项目的模块名称,默认情况下maven会在artifactId添加version作为最后生成的名称。例如:spirng-mvn-2.0.0.jar

Maven项目命名规范的更多相关文章

  1. java项目命名规范

    一.命名规范 1. 项目名全部小写 2. 包名全部小写 3. 类名首字母大写,如果类名由多个单词组成,每个单词的首字母都要大写. 如:public class MyFirstClass{} 4. 变量 ...

  2. Java基础学习总结(32)——Java项目命名规范

    一.命名规范 1. 项目名全部小写 2. 包名全部小写 3. 类名首字母大写,如果类名由多个单词组成,每个单词的首字母都要大写. 如:public class MyFirstClass{} 4. 变量 ...

  3. php项目命名规范

    命名规范 ThinkPHP5遵循PSR-2命名规范和PSR-4自动加载规范,并且注意如下规范: 目录和文件 目录使用小写+下划线: 类库.函数文件统一以.php为后缀: 类的文件名均以命名空间定义,并 ...

  4. javaWeb项目命名规范

    一.项目结构 这里和其他项目区别不大,我将模板抽离出来,更容易分析和理解: 解释一下:js主要包括extends(引入第三方的js).module(项目模块自己的js).lib(引用包,这里也可以继续 ...

  5. IntelliJ IDEA 2017.3 多模块右边栏 maven projects,maven项目命名问题

    我新建了一个maven web 模块,命名为cloud-access,可是install的时候,名字突然变为cloud-access Maven Webapp了,我就纳闷了,怎么回事.找了很久没发现原 ...

  6. 【IDEA使用技巧】(4) —— IDEA 构建Java Maven项目、导入Eclipse项目、多Module Maven项目

    1.IntelliJ IDEA构建Java Maven项目 1.1. IDEA构建Java Maven项目 ①选择Create New Project,选择创建Maven项目,并勾选Create fr ...

  7. Maven命名规范收集

    一.基本命名规范: groupId:定义当前Maven项目隶属的实际项目,例如org.sonatype.nexus,此id前半部分org.sonatype代表此项目隶属的组织或公司,后部分代表项目的名 ...

  8. iOS项目的命名规范

    一.关于本文档1.本文档的书写目的    <iOS项目的命名规范>的书写目的,在于让后续参加到该项目的iOS开发人员通过阅读该文档,了解在当前iOS项目的代码中的命名要求并严格按照本文档执 ...

  9. SSH框架项目开发命名规范

    SSH 框架项目开发命名规范   一.各层包及类命名规范   总体原则:包名所有字母小写,类名采用 "驼峰标识",具体如下:   1. Action 类      包命名规范:co ...

随机推荐

  1. hive删除空分区

    当hive中分区字段有NULL值时,hive会使用dynamic partition,数据会放到一个特殊的分区,这个分区由参数“hive.exec.default.partition.name”控制, ...

  2. Nginx配置proxy_pass转发/路径问题

    proxy_ignore_client_abort on; #不允许代理端主动关闭连接 upstream的负载均衡,四种调度算法 #调度算法1:轮询.每个请求按时间顺序逐一分配到不同的后端服务器,如果 ...

  3. c# 格式化时间

    var dt = DateTime.Now; string tmp = string.Format("{0}{1}-{2:00}-{3:00}.*.{4}", "&quo ...

  4. 安装Dubbo-admin

    1.下载dubbo源码 源码地址为github上的地址,可以使用git或者直接下载压缩包.https://github.com/alibaba/dubbo/tree/2.5.x 2.下载完之后的目录结 ...

  5. 【APM】Pinpoint 使用教程(二)

    本例介绍Pinpoint使用教程 Pinpoint安装部署参考:[APM]Pinpoint 安装部署(一) 查看应用调用关系拓扑图 进入pintpoint->选择应用-〉选择查看的时间周期,即可 ...

  6. fail2ban的功能和特性(实测)

    fail2ban的功能和特性 https://fedoraproject.org/wiki/Fail2ban_with_FirewallD 1.支持大量服务.如sshd,apache,qmail,pr ...

  7. spring boot的actuator

    actuator官方的介绍 Spring Boot includes a number of additional features to help you monitor and manage yo ...

  8. Windows 10 多用户同时远程登录

    win服务器版默认是支持多用户登陆的,甚至可以在主机上用不同用户自己远程登陆自己,如window server 2016. Win10 正常情况下是不允许用户同时远程的,即一个用户远程进来会把另一个用 ...

  9. ACM- 编程练习网站--输入数据方法

    #include "stdafx.h" #include <iostream> #include <string> #include <algorit ...

  10. MariaDB 10.3 序列

    在MariaDB .3版本中sequence是特殊的表,和表使用相同的namespace,因此表和序列的名字不能相同. MariaDB [wuhan]> select version(); +- ...