Skip to content

Commit 3b12b9e

Browse files
authored
chore: skip nexus-staging-maven-plugin (#898)
1 parent 9504a25 commit 3b12b9e

File tree

1 file changed

+50
-16
lines changed

1 file changed

+50
-16
lines changed

pom.xml

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,6 @@
225225
<build>
226226
<pluginManagement>
227227
<plugins>
228-
<plugin>
229-
<groupId>org.sonatype.plugins</groupId>
230-
<artifactId>nexus-staging-maven-plugin</artifactId>
231-
<version>1.6.13</version>
232-
<extensions>true</extensions>
233-
<configuration>
234-
<serverId>ossrh</serverId>
235-
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
236-
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
237-
</configuration>
238-
</plugin>
239228
<plugin>
240229
<groupId>org.apache.maven.plugins</groupId>
241230
<artifactId>maven-deploy-plugin</artifactId>
@@ -331,11 +320,6 @@
331320
</executions>
332321

333322
</plugin>
334-
335-
<plugin>
336-
<groupId>org.sonatype.plugins</groupId>
337-
<artifactId>nexus-staging-maven-plugin</artifactId>
338-
</plugin>
339323
<plugin>
340324
<groupId>org.apache.maven.plugins</groupId>
341325
<artifactId>maven-deploy-plugin</artifactId>
@@ -345,6 +329,56 @@
345329

346330
<profiles>
347331

332+
<profile>
333+
<!-- By default, we release artifacts to Sonatype, which requires
334+
nexus-staging-maven-plugin. -->
335+
<id>release-sonatype</id>
336+
<activation>
337+
<property>
338+
<!-- Only when we use the release-gcp-artifact-registry profile,
339+
which comes with artifact-registry-url property, this profile is
340+
turned off. -->
341+
<name>!artifact-registry-url</name>
342+
</property>
343+
</activation>
344+
<build>
345+
<plugins>
346+
<plugin>
347+
<groupId>org.sonatype.plugins</groupId>
348+
<artifactId>nexus-staging-maven-plugin</artifactId>
349+
<version>1.6.13</version>
350+
<extensions>true</extensions>
351+
<configuration>
352+
<serverId>sonatype-nexus-staging</serverId>
353+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
354+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
355+
</configuration>
356+
</plugin>
357+
</plugins>
358+
</build>
359+
</profile>
360+
<profile>
361+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
362+
this release-gcp-artifact-registry profile:
363+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
364+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
365+
-->
366+
<id>release-gcp-artifact-registry</id>
367+
<properties>
368+
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url>
369+
</properties>
370+
<distributionManagement>
371+
<repository>
372+
<id>gcp-artifact-registry-repository</id>
373+
<url>${artifact-registry-url}</url>
374+
</repository>
375+
<snapshotRepository>
376+
<id>gcp-artifact-registry-repository</id>
377+
<url>${artifact-registry-url}</url>
378+
</snapshotRepository>
379+
</distributionManagement>
380+
</profile>
381+
348382
<profile>
349383
<id>default</id>
350384
<activation>

0 commit comments

Comments
 (0)