Skip to content

Commit 8a496d3

Browse files
authored
fix: fixed the profile for Artifact Registry deployment (#950)
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/...
1 parent 1b42e0f commit 8a496d3

File tree

2 files changed

+54
-18
lines changed

2 files changed

+54
-18
lines changed

java-shared-config/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -381,18 +381,6 @@
381381
</executions>
382382
</plugin>
383383
</plugins>
384-
<extensions>
385-
<extension>
386-
<!--
387-
Enables the "artifactregistry://" URL scheme (go/airlock/howto_maven).
388-
Note that Maven extensions cannot be included in profiles (
389-
https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms)
390-
-->
391-
<groupId>com.google.cloud.artifactregistry</groupId>
392-
<artifactId>artifactregistry-maven-wagon</artifactId>
393-
<version>2.2.3</version>
394-
</extension>
395-
</extensions>
396384
</build>
397385

398386
<reporting>

native-image-shared-config/pom.xml

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,62 @@
9999
</plugin>
100100
</plugins>
101101
</pluginManagement>
102-
<plugins>
103-
<plugin>
104-
<groupId>org.sonatype.plugins</groupId>
105-
<artifactId>nexus-staging-maven-plugin</artifactId>
106-
</plugin>
107-
</plugins>
102+
<extensions>
103+
<extension>
104+
<!--
105+
Enables the "artifactregistry://" URL scheme (go/airlock/howto_maven).
106+
Note that Maven extensions cannot be included in profiles (
107+
https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms)
108+
-->
109+
<groupId>com.google.cloud.artifactregistry</groupId>
110+
<artifactId>artifactregistry-maven-wagon</artifactId>
111+
<version>2.2.3</version>
112+
</extension>
113+
</extensions>
108114
</build>
109115
<profiles>
116+
<profile>
117+
<!-- By default, we release artifacts to Sonatype, which requires
118+
nexus-staging-maven-plugin. -->
119+
<id>release-sonatype</id>
120+
<activation>
121+
<property>
122+
<!-- Only when we use the release-gcp-artifact-registry profile,
123+
which comes with artifact-registry-url property, this profile is
124+
turned off. -->
125+
<name>!artifact-registry-url</name>
126+
</property>
127+
</activation>
128+
<build>
129+
<plugins>
130+
<plugin>
131+
<groupId>org.sonatype.plugins</groupId>
132+
<artifactId>nexus-staging-maven-plugin</artifactId>
133+
</plugin>
134+
</plugins>
135+
</build>
136+
</profile>
137+
<profile>
138+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
139+
this release-gcp-artifact-registry profile:
140+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
141+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
142+
-->
143+
<id>release-gcp-artifact-registry</id>
144+
<properties>
145+
<artifact-registry-url>artifactregistry://undefined-artifact-registry-url-value</artifact-registry-url>
146+
</properties>
147+
<distributionManagement>
148+
<repository>
149+
<id>gcp-artifact-registry-repository</id>
150+
<url>${artifact-registry-url}</url>
151+
</repository>
152+
<snapshotRepository>
153+
<id>gcp-artifact-registry-repository</id>
154+
<url>${artifact-registry-url}</url>
155+
</snapshotRepository>
156+
</distributionManagement>
157+
</profile>
110158
<profile>
111159
<id>release</id>
112160
<activation>

0 commit comments

Comments
 (0)