Skip to content

Commit

Permalink
fix: fixed the profile for Artifact Registry deployment
Browse files Browse the repository at this point in the history
The java-shared-config repository was able to publish the
artifacts to my Artifact Registry:

mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
  -P=-release-staging-repository -Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
  • Loading branch information
suztomo committed Dec 10, 2024
1 parent 1b42e0f commit b1842eb
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 18 deletions.
12 changes: 0 additions & 12 deletions java-shared-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -381,18 +381,6 @@
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<!--
Enables the "artifactregistry://" URL scheme (go/airlock/howto_maven).
Note that Maven extensions cannot be included in profiles (
https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms)
-->
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.3</version>
</extension>
</extensions>
</build>

<reporting>
Expand Down
60 changes: 54 additions & 6 deletions native-image-shared-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,62 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
<extensions>
<extension>
<!--
Enables the "artifactregistry://" URL scheme (go/airlock/howto_maven).
Note that Maven extensions cannot be included in profiles (
https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms)
-->
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.3</version>
</extension>
</extensions>
</build>
<profiles>
<profile>
<!-- By default, we release artifacts to Sonatype, which requires
nexus-staging-maven-plugin. -->
<id>release-sonatype</id>
<activation>
<property>
<!-- Only when we use the release-gcp-artifact-registry profile,
which comes with artifact-registry-url property, this profile is
turned off. -->
<name>!artifact-registry-url</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
this release-gcp-artifact-registry profile:
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
-->
<id>release-gcp-artifact-registry</id>
<properties>
<artifact-registry-url>artifactregistry://undefined-artifact-registry-url-value</artifact-registry-url>
</properties>
<distributionManagement>
<repository>
<id>gcp-artifact-registry-repository</id>
<url>${artifact-registry-url}</url>
</repository>
<snapshotRepository>
<id>gcp-artifact-registry-repository</id>
<url>${artifact-registry-url}</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>release</id>
<activation>
Expand Down

0 comments on commit b1842eb

Please sign in to comment.