Maven project naming convention

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


The above is the official website maven document, naming conventions guidelines (https://maven.apache.org/guides/mini/guide-naming-conventions.html)

Overall:
groupId: define the actual Maven project under the current project, for example org.sonatype.nexus, this id org.sonatype the first half of this project on behalf of the membership of the organization or company, after the name of the representative part of the project, if this project is more than module, then the development of sub-module, then it can be divided into org.sonatype.nexus.plugins and org.sonatype.nexus.utils and so on.

Of particular note is the corresponding item should not groupId affiliated organizations or companies, that is to say not only org.sonatype groupId without nexus.

For example: I am building a project, which is thereafter a general platform for all projects, it should be groupId org.limingming.projectName, projectName is the name of the platform, org.limingming on behalf of my own organization, if where I Inspur Group is the case it should be com.inspur.loushang.

artifactId a member ID, a Maven project This element defines the actual project or sub-modules, as mentioned above, the official convention, construct name must be lowercase, no other special characters recommended "Actual Project Name - name of the module" defined manner, for example: spirng-mvn, spring-core like.
Recommended formats: actual artifactId project name as a prefix, followed by a module name
Example: nexus-indexer, spring-mvcThese are the actual item id name as a prefix, and then followed by a line through, then followed by the module name of the project, by default maven version will be added as the name of the last generation in artifactId. For example: spirng-mvn-2.0.0.jar

Guess you like

Origin www.cnblogs.com/lukelook/p/11521187.html