본문으로 바로가기

 

 

 Spring 프로젝트 생성 시 Group, Artifact, Version 명명

 

참고 : Spring boot 프로젝트 생성과정에서 궁금해서 찾아보았지만, Maven 프로젝트 전반에 해당하는 내용이다.

 

# GroupId

  • groupId uniquely identifies your project across all projects. A group ID should follow Java's package name rules. This means it starts with a reversed domain name you control.
  • For example, org.apache.maven, org.apache.commons
  • You can create as many subgroups as you want. 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

 

-> groupId는 Java의 패키지이름 규칙을 따를 것.  즉, 도메인 네임을 반전시켜 사용. (org.apache.maven)

-> 서브그룹 만드는 것은 자유. 다만 프로젝트 구조를 따르는 것이 좋다. 즉, 여러 모듈로 된 프로젝트라면 새 식별자를 추가하자. (org.apache.maven.plugins)

    

  • Maven does not enforce this rule. There are many legacy projects that do not follow this convention and instead use single word group IDs. However, it will be difficult to get a new single word group ID approved for inclusion in the Maven Central repository.

 

-> 규칙을 지키는 것은 자유. 규칙을 무시하고 단일 단어만을 사용한 기존 프로젝트들이 많음. 이런 프로젝트의 경우에 Maven Central repository 승인을 받기는 어려움 (결국에는 규칙을 따르는 것을 권고하는...🤔)

 

 

# ArtifactId

  • 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

 

-> artifactId는 version정보를 제외한 jar 파일의 이름에 해당. 소문자를 사용.

 

 

# Version

  • 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

 

-> Version은 버전 정보에 해당.


# 참고자료

- Maven 문서

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

 

Maven – Guide to Naming Conventions

 

maven.apache.org

 

반응형