Skip to content

Commit 5f56258

Browse files
authored
ci: wrap nexus-staging-maven-plugin with a profile (#7059)
The profile matches java-shared-config. https://github.com/googleapis/java-shared-config/blob/main/native-image-shared-config/pom.xml#L112
1 parent c7aee7a commit 5f56258

2 files changed

Lines changed: 72 additions & 22 deletions

File tree

google-cloud-bom/pom.xml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,18 +258,22 @@
258258
</dependencyManagement>
259259

260260
<build>
261+
<pluginManagement>
262+
<plugins>
263+
<plugin>
264+
<groupId>org.sonatype.plugins</groupId>
265+
<artifactId>nexus-staging-maven-plugin</artifactId>
266+
<version>1.7.0</version>
267+
<extensions>true</extensions>
268+
<configuration>
269+
<serverId>sonatype-nexus-staging</serverId>
270+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
271+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
272+
</configuration>
273+
</plugin>
274+
</plugins>
275+
</pluginManagement>
261276
<plugins>
262-
<plugin>
263-
<groupId>org.sonatype.plugins</groupId>
264-
<artifactId>nexus-staging-maven-plugin</artifactId>
265-
<version>1.7.0</version>
266-
<extensions>true</extensions>
267-
<configuration>
268-
<serverId>sonatype-nexus-staging</serverId>
269-
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
270-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
271-
</configuration>
272-
</plugin>
273277
<plugin>
274278
<groupId>org.apache.maven.plugins</groupId>
275279
<artifactId>maven-site-plugin</artifactId>
@@ -331,6 +335,27 @@
331335
</reporting>
332336

333337
<profiles>
338+
<profile>
339+
<!-- By default, we release artifacts to Sonatype, which requires
340+
nexus-staging-maven-plugin. -->
341+
<id>release-sonatype</id>
342+
<activation>
343+
<property>
344+
<!-- Only when we use the release-gcp-artifact-registry profile,
345+
which comes with artifact-registry-url property, this profile is
346+
turned off. -->
347+
<name>!artifact-registry-url</name>
348+
</property>
349+
</activation>
350+
<build>
351+
<plugins>
352+
<plugin>
353+
<groupId>org.sonatype.plugins</groupId>
354+
<artifactId>nexus-staging-maven-plugin</artifactId>
355+
</plugin>
356+
</plugins>
357+
</build>
358+
</profile>
334359
<profile>
335360
<id>release</id>
336361
<activation>

libraries-bom/pom.xml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,22 @@
9393
</dependencyManagement>
9494

9595
<build>
96+
<pluginManagement>
97+
<plugins>
98+
<plugin>
99+
<groupId>org.sonatype.plugins</groupId>
100+
<artifactId>nexus-staging-maven-plugin</artifactId>
101+
<version>1.7.0</version>
102+
<extensions>true</extensions>
103+
<configuration>
104+
<serverId>sonatype-nexus-staging</serverId>
105+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
106+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
107+
</configuration>
108+
</plugin>
109+
</plugins>
110+
</pluginManagement>
96111
<plugins>
97-
<plugin>
98-
<groupId>org.sonatype.plugins</groupId>
99-
<artifactId>nexus-staging-maven-plugin</artifactId>
100-
<version>1.7.0</version>
101-
<extensions>true</extensions>
102-
<configuration>
103-
<serverId>sonatype-nexus-staging</serverId>
104-
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
105-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
106-
</configuration>
107-
</plugin>
108112
<plugin>
109113
<groupId>org.codehaus.mojo</groupId>
110114
<artifactId>flatten-maven-plugin</artifactId>
@@ -117,6 +121,27 @@
117121
</plugins>
118122
</build>
119123
<profiles>
124+
<profile>
125+
<!-- By default, we release artifacts to Sonatype, which requires
126+
nexus-staging-maven-plugin. -->
127+
<id>release-sonatype</id>
128+
<activation>
129+
<property>
130+
<!-- Only when we use the release-gcp-artifact-registry profile,
131+
which comes with artifact-registry-url property, this profile is
132+
turned off. -->
133+
<name>!artifact-registry-url</name>
134+
</property>
135+
</activation>
136+
<build>
137+
<plugins>
138+
<plugin>
139+
<groupId>org.sonatype.plugins</groupId>
140+
<artifactId>nexus-staging-maven-plugin</artifactId>
141+
</plugin>
142+
</plugins>
143+
</build>
144+
</profile>
120145
<profile>
121146
<id>release</id>
122147
<activation>

0 commit comments

Comments
 (0)