자바 (27). Spring Project Group Artifact 네이밍
3월의 마지막을 장식하는 포스팅
0. 차례
- 차례
- 들어가기전에
- GROUP ID
- ARTIFACT ID
1. 들어가기전에
3월은 정말 포스팅을 많이 못한것 같다. 최근 회사서 챗봇 v3.0을 들어가게 되면서, 정신도 없었고,, (그냥 공부를 안했다.)
그래도 다뤄볼만한 여러 주제들을 보긴 했는데,, NLP 쪽이나, LOGSTASH, Jpype 등 최근 프로젝트를 하며 정리했던 내용을 좀 포스팅 하려 했는데,
일단 이 포스팅부터 하고 가려 한다. 시간이 많이 없기떄문에 3월에 너무 안써서,,
잡담은 여기까지 하고, 뭐 자바 글도 많이 썼지만, 우리가 자바 프로젝트를 생성할때 처음 쓰는 Group과 Artifact 는 뭔지 그냥 써보려 한다.
2. Group ID
groupId 에는 프로젝트마다 구별할 수 있는 고유한 이름이다. 보통은 java 패키지 네이밍을 일컫는다.
ex) org.apache.maven, org.apache.commons
이 규칙은 강제적인것은 아니지만
groupId에 많은 하위 group을 만들때, 즉 멀티 프로젝트를 생성할때, 새로운 식별자만 부모 group id 뒤에 붙이는 식으로 사용하여 관리할 수 있다.
정리를 하면 groupId는 아래와 같다.
정리
- 여러 프로젝트에서 나의 프로젝트를 식별하게 해주는 식별자이다.
- groupId는 Java 패키지 이름 규칙을 따르며, 도메인 이름의 반대로 시작한다. (org.apache.maven, org.apache.commons)
- 만약에 프로젝트가 다중 모듈 프로젝트인 경우 부모의 groupId에 새 식별자를 추가하여 사용 ex ) org.apache.maven, org.apache.maven.plugins, org.apache.maven.reporting
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 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.
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
Artifact ID
artifactid는 jar파일에서 버전 정보를 뺀 이름이다. 소문자를 사용하고 특수문자는 사용하지 않는다. 써드 파티 jar파일인 경우면, 할당된 이름을 사용한다.
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
Comments