创建maven项目的时候groupId、ArtifactId、Version等参数的设置建议

官方文档

Guide to naming conventions on groupId, artifactId, and version
groupId uniquely identifies your project across all projects, so we need to enforce a naming schema. A groupId must follow Java's package name rules. This means it must start with a reversed domain name you control. 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. For example,

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. For example,
2.0, 2.0.1, 1.3.1

翻译版
关于groupId,artifactId和version的命名约定的指南
groupId在所有项目中唯一标识您的项目,因此我们需要强制执行命名模式。groupId必须遵循Java的包名称规则。这意味着它必须以您控制的反向域名开头。您可以根据需要创建任意数量的子组。查看有关包名称的更多信息。
例如。org.apache.maven,org.apache.commons

确定groupId粒度的一种好方法是使用项目结构。也就是说,如果当前项目是一个多模块项目,它应该将新标识符附加到父项的groupId。例如,

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

artifactId是没有版本的jar的名称。如果你创建了它,那么你可以用小写字母和没有奇怪的符号选择你想要的任何名称。如果它是第三方jar,你必须在分发时获取jar的名称。
例如。maven,commons-math

如果你发布它的版本,那么你可以选择任何带有数字和点的典型版本(1.0,1.1,1.0.1,…)。不要使用日期,因为它们通常与SNAPSHOT(夜间)构建相关联。如果它是第三方神器,你必须使用它们的版本号,不管它看起来多么奇怪。例如,
2.0,2.0.1,1.3.1

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值