From 73f963ed0f1008c99a5bf28cc491beab6390a842 Mon Sep 17 00:00:00 2001 From: Kensuke Nagae Date: Tue, 4 Feb 2025 16:09:04 +0900 Subject: [PATCH] Update GitHub Packages Apache Maven registry artifactId case limitation (#54218) Co-authored-by: mchammer01 <42146119+mchammer01@users.noreply.github.com> --- .../publishing-java-packages-with-maven.md | 4 +++- .../working-with-the-apache-maven-registry.md | 2 ++ .../package_registry/maven-package-naming-convention.md | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 data/reusables/package_registry/maven-package-naming-convention.md diff --git a/content/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven.md b/content/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven.md index e2a4364758ca..f796f3dc6689 100644 --- a/content/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven.md +++ b/content/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven.md @@ -17,7 +17,7 @@ topics: - Java - Maven --- - + {% data reusables.actions.enterprise-github-hosted-runners %} ## Introduction @@ -41,6 +41,8 @@ You may also find it helpful to have a basic understanding of the following: The `groupId` and `artifactId` fields in the _pom.xml_ file create a unique identifier for your package that registries use to link your package to a registry. For more information see [Guide to uploading artifacts to the Central Repository](https://maven.apache.org/repository/guide-central-repository-upload.html) in the Apache Maven documentation. +{% data reusables.package_registry.maven-package-naming-convention %} + The _pom.xml_ file also contains configuration for the distribution management repositories that Maven will deploy packages to. Each repository must have a name and a deployment URL. Authentication for these repositories can be configured in the _.m2/settings.xml_ file in the home directory of the user running Maven. You can use the `setup-java` action to configure the deployment repository as well as authentication for that repository. For more information, see [`setup-java`](https://github.com/actions/setup-java). diff --git a/content/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry.md b/content/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry.md index 08bdafc83b40..306a4395f26a 100644 --- a/content/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry.md +++ b/content/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry.md @@ -136,6 +136,8 @@ If your instance has subdomain isolation disabled: {% data reusables.package_registry.default-name %} For example, {% data variables.product.prodname_dotcom %} will publish a package named `com.example:test` in a repository called `OWNER/test`. +{% data reusables.package_registry.maven-package-naming-convention %} + If you would like to publish multiple packages to the same repository, you can include the URL of the repository in the `` element of the _pom.xml_ file. {% data variables.product.prodname_dotcom %} will match the repository based on that field. Since the repository name is also part of the `distributionManagement` element, there are no additional steps to publish multiple packages to the same repository. For more information on creating a package, see the [maven.apache.org documentation](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html). diff --git a/data/reusables/package_registry/maven-package-naming-convention.md b/data/reusables/package_registry/maven-package-naming-convention.md new file mode 100644 index 000000000000..65b0d2155c04 --- /dev/null +++ b/data/reusables/package_registry/maven-package-naming-convention.md @@ -0,0 +1 @@ +>[!WARNING] Your Apache Maven package must follow the naming convention, and therefore the `artifactId` field should only contain lowercase letters, digits, or hyphens. For more information, see [Naming convention of Maven coordinates](https://maven.apache.org/guides/mini/guide-naming-conventions.html) in the maven.apache.org documentation. If you use upercase letters in the artifact name, you'll get a _422 Unprocessable Entity_ response.