관리 메뉴

나만의공간

Gradle(Maven) groupId / artifactId 란 본문

Tools/Gradle

Gradle(Maven) groupId / artifactId 란

밥알이 2021. 12. 3. 10:56

Apache Maven Project 원문

Guide to naming conventions on groupId, artifactId, and version

  • 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.commonsYou 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
  • 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.
  • 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. For example,2.0, 2.0.1, 1.3.1

GroupId, actifactId 및 버전 명명 규칙

  • groupId는 모든 프로젝트에서 프로젝트를 고유하게 식별한다. groupId는 Java 패키지 네이밍 규칙을 따른다. 이것은 역 도메인 이름으로 시작한다는것을 의미하며, 샘플은 아래와 같다.
    -. org.apache.maven, org.apache.commons

  • Maven은 이 규칙을 적용하지 않습니다. 레거시 프로젝트는 단일 단어 그룹ID를 프로젝트들이 많이 있습니다. Mave 저장소에 포함하도록 승인된 새로운 단어 그룹 ID를 얻는 것은 어렵습니다.

  • artifactId 는 Version이 없는 Jar 이름 입니다. 만약 Jar 파일을 생성했다면, 소문자와 특수문자가 없는 원하는 이름을 선택하세요.
    만약 third party jar가 같이 배포 되는 경우 jar 이름을 써야 합니다.
    -. maven, common-math

  • version을 배포하는 경우 숫자와 점이 있는 일반적인 버전(1.0, 1.1, 1.0.1, ...)을 선택할 수 있습니다. 날짜는 일반적으로 SNAPSHOT(야간) 빌드와 연결되므로 사용하지 마십시오. 그것이 제3자 아티팩트라면, 그것이 무엇이든, 그리고 그것이 보일 수 있는 이상하게도 그들의 버전 번호를 사용해야 합니다

'Tools > Gradle' 카테고리의 다른 글

3. Gradle을 이용한 JVM Libraries 생성법  (0) 2017.03.16
2. Gradle Build 신규생성법  (0) 2017.03.15
1. Gradle 설치  (0) 2017.03.08
Comments