Skip to content

Commit 7a8e4f8

Browse files
authored
ci: Maven profile for Artifact Registry release (#936)
* ci: profile for Artifact Registry release
1 parent 438693d commit 7a8e4f8

2 files changed

Lines changed: 69 additions & 35 deletions

File tree

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: 69 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,78 @@
8181
</dependency>
8282
</dependencies>
8383
</dependencyManagement>
84-
8584
<build>
86-
<pluginManagement>
87-
<plugins>
88-
<plugin>
89-
<groupId>org.sonatype.plugins</groupId>
90-
<artifactId>nexus-staging-maven-plugin</artifactId>
91-
<version>1.7.0</version>
92-
<extensions>true</extensions>
93-
<configuration>
94-
<serverId>ossrh</serverId>
95-
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
96-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
97-
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
98-
</configuration>
99-
</plugin>
100-
</plugins>
101-
</pluginManagement>
102-
<plugins>
103-
<plugin>
104-
<groupId>org.sonatype.plugins</groupId>
105-
<artifactId>nexus-staging-maven-plugin</artifactId>
106-
</plugin>
107-
</plugins>
85+
<extensions>
86+
<extension>
87+
<!--
88+
Enables the "artifactregistry://" URL scheme in Artifact Registry (Airlock and ExitGate).
89+
Note that Maven extensions cannot be included in profiles (
90+
https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms)
91+
-->
92+
<groupId>com.google.cloud.artifactregistry</groupId>
93+
<artifactId>artifactregistry-maven-wagon</artifactId>
94+
<version>2.2.3</version>
95+
</extension>
96+
</extensions>
10897
</build>
10998
<profiles>
99+
<profile>
100+
<!-- By default, we release artifacts to Sonatype, which requires
101+
nexus-staging-maven-plugin. -->
102+
<id>release-sonatype</id>
103+
<activation>
104+
<activeByDefault>true</activeByDefault>
105+
</activation>
106+
<build>
107+
<pluginManagement>
108+
<plugins>
109+
<plugin>
110+
<groupId>org.sonatype.plugins</groupId>
111+
<artifactId>nexus-staging-maven-plugin</artifactId>
112+
<version>1.7.0</version>
113+
<extensions>true</extensions>
114+
<configuration>
115+
<serverId>ossrh</serverId>
116+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
117+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
118+
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
119+
</configuration>
120+
</plugin>
121+
</plugins>
122+
</pluginManagement>
123+
<plugins>
124+
<plugin>
125+
<groupId>org.sonatype.plugins</groupId>
126+
<artifactId>nexus-staging-maven-plugin</artifactId>
127+
</plugin>
128+
</plugins>
129+
</build>
130+
</profile>
131+
<profile>
132+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
133+
this release-gcp-artifact-registry profile:
134+
135+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
136+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
137+
-->
138+
<id>release-gcp-artifact-registry</id>
139+
<activation>
140+
<activeByDefault>false</activeByDefault>
141+
</activation>
142+
<properties>
143+
<artifact-registry-url>artifactregistry://undefined-artifact-registry-url-value</artifact-registry-url>
144+
</properties>
145+
<distributionManagement>
146+
<repository>
147+
<id>gcp-artifact-registry-repository</id>
148+
<url>${artifact-registry-url}</url>
149+
</repository>
150+
<snapshotRepository>
151+
<id>gcp-artifact-registry-repository</id>
152+
<url>${artifact-registry-url}</url>
153+
</snapshotRepository>
154+
</distributionManagement>
155+
</profile>
110156
<profile>
111157
<id>release</id>
112158
<activation>

0 commit comments

Comments
 (0)