스냅샷은 자바 프로젝트의 출시 전 버전입니다. 스냅샷의 버전 번호에는 프로젝트 객체 모델(POM)에 서픽스 -SNAPSHOT이 포함됩니다. 예를 들어 pom.xml 파일의 이 설정은 개발 중인 프로젝트의 1.0 버전에 대한 것입니다.
<version>1.0-SNAPSHOT</version>
이 프로젝트에서 패키지를 게시하면 Maven 3은 각 스냅샷 버전이 고유하도록 스냅샷 버전 번호에 타임스탬프를 자동으로 추가합니다. Maven 2는 저장소의 기존 스냅샷을 덮어쓰는 수단으로 고유하지 않은 스냅샷 버전을 지원합니다. 이 방법은 빌드의 재현성에 문제가 되므로 Maven 3은 더 이상 고유하지 않은 스냅샷을 지원하지 않습니다.
스냅샷을 사용하면 저장소에 게시할 때마다 Maven 프로젝트에서 버전 번호를 증가시키지 않고 출시 전 패키지의 업데이트된 버전을 반복적으로 게시할 수 있습니다. 개발 중에 패키지에 대한 종속 항목이 있는 다른 프로젝트는 저장소에서 1.0 버전의 최신 스냅샷을 가져올 수 있습니다.
Maven 버전 번호 구문과 정렬 순서에 대한 자세한 내용은 버전 순서 사양을 참조하세요.
출시
패키지를 출시할 준비가 되면 POM 파일의 버전 번호에서 -SNAPSHOT 서픽스를 삭제하고 패키지를 사용하는 프로젝트가 스냅샷 버전 대신 출시 버전을 사용하도록 업데이트합니다.
모든 스냅샷 종속 항목을 나열하려면 다음 명령어를 사용하여 종속 항목 트리를 필터링하면 됩니다.
mvndependency:tree-Dincludes=:::*-SNAPSHOT
Artifact Registry 버전 정책
Artifact Registry에서 Maven 저장소를 만들 때 Maven 버전 정책을 지정할 수 있습니다.
없음 - 스냅샷과 출시 패키지를 모두 저장합니다. 기본 설정입니다.
스냅샷 - 스냅샷 패키지만 저장합니다.
출시 - 출시 패키지만 저장합니다.
스냅샷 버전 정책을 선택하는 경우 저장소에서 일치하는 버전을 덮어쓰는 고유하지 않은 스냅샷 버전을 허용할지 여부도 지정할 수 있습니다. Maven 3은 고유하지 않은 버전 모델을 지원하지 않으므로 고유 버전을 사용하는 것이 좋습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eArtifact Registry supports Java packages built with Maven and Gradle, offering resources like a quickstart guide for those new to the platform.\u003c/p\u003e\n"],["\u003cp\u003eUsers can create various repository types, including remote and virtual, and control access via specific permissions for accounts connecting to the repository.\u003c/p\u003e\n"],["\u003cp\u003eConfiguration for common tools like Maven, Gradle, and Cloud Build are supported, along with a community-created sbt plugin, and instructions to deploy to Google Cloud runtime environments.\u003c/p\u003e\n"],["\u003cp\u003eMaven differentiates between snapshot versions, which are pre-release and marked with \u003ccode\u003e-SNAPSHOT\u003c/code\u003e, and release versions, where the suffix is removed when the package is finalized.\u003c/p\u003e\n"],["\u003cp\u003eArtifact Registry offers different Maven version policies, such as storing both snapshot and release packages, or snapshot only or release only, with the option for unique or non-unique versions for snapshot packages.\u003c/p\u003e\n"]]],[],null,["# Manage Java packages\n\nArtifact Registry supports Java packages that you build with Maven and Gradle.\n\nOverview\n--------\n\nTo get familiar with Java packages in Artifact Registry, you can try the\n[quickstart](/artifact-registry/docs/java/quickstart).\n\nWhen you are ready to learn more, read the following information:\n\n1. [Create a Java package repository](/artifact-registry/docs/repositories/create-repos) for your packages.\n2. Learn how to create [remote](/artifact-registry/docs/repositories/remote-repo) and [virtual](/artifact-registry/docs/repositories/virtual-repo) repositories.\n3. Read about how remote and virtual repositories can be used in this [repository usage example](/artifact-registry/docs/repositories#repository_usage_example).\n4. [Grant permissions](/artifact-registry/docs/access-control) to the account that will connect with the repository. Service accounts for common integrations with Artifact Registry have default [permissions](/artifact-registry/docs/access-control#gcp) for repositories in the same project.\n5. Configure your tools:\n - [Configure authentication](/artifact-registry/docs/java/authentication) for Maven or Gradle.\n - If you want to use [sbt](https://www.scala-sbt.org/1.x/docs/Getting-Started.html) as a build tool for Scala and Java instead of using Maven or Gradle, there is a [community-created sbt plugin](https://index.scala-lang.org/abdolence/sbt-gcs-resolver/sbt-gcs-plugin/) available. This documentation does not describe configuration or usage of Scala clients..\n - [Configure Cloud Build](/artifact-registry/docs/configure-cloud-build) to upload and download packages.\n - Learn about [deploying](/artifact-registry/docs/deploy) to Google Cloud runtime environments.\n6. [Learn about managing packages](/artifact-registry/docs/java/manage-packages).\n\nMaven snapshot and release versions\n-----------------------------------\n\nMaven distinguishes between *snapshot* and *release* versions of your\nMaven projects.\n\n### Snapshots\n\nA snapshot is a pre-release version of a Java project. The version number\nfor a snapshot includes the suffix `-SNAPSHOT` in the your Project Object Model\n(POM). For example, this setting in the `pom.xml` file is for a `1.0` version\nof project that is in development: \n\n \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\nWhen you publish a package from this project, Maven 3 automatically appends\na timestamp to the snapshot version number so that each snapshot version is\nunique. Maven 2 supports non-unique snapshot versions as a means to overwrite\nexisting snapshots in a repository. This approach is problematic for\nreproducibility of builds, which is why Maven 3 no longer supports non-unique\nsnapshots.\n\nSnapshots provide a way for you to iteratively publish updated versions of a\npre-release package without incrementing the version number in your Maven\nproject every time that you publish to the repository. During development,\nother projects with dependencies on the package can then obtain the latest\nsnapshot of version `1.0` from the repository.\n\nRefer to\n[version order specification](https://maven.apache.org/pom.html#version-order-%0Aspecification) for details about Maven version number syntax\nand sort order.\n\n### Releases\n\nWhen you are ready to release a package, you remove the `-SNAPSHOT` suffix\nfrom the version number in the POM file and update any projects that depend on\nthe package so that they use the release version instead of the snapshot\nversion.\n\nTo list all snapshot dependencies, you can\n[filter the dependency tree](https://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html)\nwith the command: \n\n mvn dependency:tree -Dincludes=:::*-SNAPSHOT\n\n### Artifact Registry version policy\n\nWhen you create a Maven repository in Artifact Registry, you can specify a\nMaven version policy:\n\n- None - Stores both snapshot and release packages. This is the default setting.\n- Snapshot - Stores snapshot packages only.\n- Release - Stores release packages only.\n\nIf you choose the snapshot version policy, you can also specify whether the\nrepository allows non-unique snapshot versions that overwrite matching versions\nin the repository. We recommend using unique versions since Maven 3 does not\nsupport the non-unique version model."]]