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.




  1. 推荐格式:使用实际项目名称作为artifactId的前缀,紧接着为模块名称
  2. 举例:nexus-indexer、spring-mvc、hibernate-c3po……这些id都是以实际项目名称作为前缀,然后接着一个中划线,再紧跟项目的模块名称,默认情况下maven会在artifactId添加version作为最后生成的名称。例如:spirng-mvn-2.0.0.jar
posted @ 2020-08-08 19:58  rainbow70626  阅读(40)  评论(0编辑  收藏