码迷,mamicode.com
首页 > 其他好文 > 详细

groupId 和 artifactID 解释

时间:2015-07-16 11:16:44      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

maven 原始:https://maven.apache.org/guides/mini/guide-naming-conventions.html

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.mavenorg.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.mavenorg.apache.maven.pluginsorg.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. mavencommons-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.02.0.11.3.1

groupId 和 artifactID 解释

标签:

原文地址:http://www.cnblogs.com/zhangxi0840/p/4650431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!