Skip to content

Commit c38efab

Browse files
committed
fix: remove unnecessary nexus plugin activation
1 parent c1f3083 commit c38efab

File tree

4 files changed

+88
-51
lines changed

4 files changed

+88
-51
lines changed

google-http-client-bom/pom.xml

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,22 @@
118118
</dependencies>
119119
</dependencyManagement>
120120
<build>
121+
<pluginManagement>
122+
<plugins>
123+
<plugin>
124+
<groupId>org.sonatype.plugins</groupId>
125+
<artifactId>nexus-staging-maven-plugin</artifactId>
126+
<version>1.7.0</version>
127+
<extensions>true</extensions>
128+
<configuration>
129+
<serverId>sonatype-nexus-staging</serverId>
130+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
131+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
132+
</configuration>
133+
</plugin>
134+
</plugins>
135+
</pluginManagement>
121136
<plugins>
122-
<plugin>
123-
<groupId>org.sonatype.plugins</groupId>
124-
<artifactId>nexus-staging-maven-plugin</artifactId>
125-
<version>1.7.0</version>
126-
<extensions>true</extensions>
127-
<configuration>
128-
<serverId>sonatype-nexus-staging</serverId>
129-
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
130-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
131-
</configuration>
132-
</plugin>
133137
<plugin>
134138
<groupId>org.apache.maven.plugins</groupId>
135139
<artifactId>maven-javadoc-plugin</artifactId>
@@ -158,6 +162,48 @@
158162
</build>
159163

160164
<profiles>
165+
<profile>
166+
<!-- By default, we release artifacts to Sonatype, which requires
167+
nexus-staging-maven-plugin. -->
168+
<id>release-sonatype</id>
169+
<activation>
170+
<property>
171+
<!-- Only when we use the release-gcp-artifact-registry profile,
172+
which comes with artifact-registry-url property, this profile is
173+
turned off. -->
174+
<name>!artifact-registry-url</name>
175+
</property>
176+
</activation>
177+
<build>
178+
<plugins>
179+
<plugin>
180+
<groupId>org.sonatype.plugins</groupId>
181+
<artifactId>nexus-staging-maven-plugin</artifactId>
182+
</plugin>
183+
</plugins>
184+
</build>
185+
</profile>
186+
<profile>
187+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
188+
this release-gcp-artifact-registry profile:
189+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
190+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
191+
-->
192+
<id>release-gcp-artifact-registry</id>
193+
<properties>
194+
<artifact-registry-url>artifactregistry://undefined-artifact-registry-url-value</artifact-registry-url>
195+
</properties>
196+
<distributionManagement>
197+
<repository>
198+
<id>gcp-artifact-registry-repository</id>
199+
<url>${artifact-registry-url}</url>
200+
</repository>
201+
<snapshotRepository>
202+
<id>gcp-artifact-registry-repository</id>
203+
<url>${artifact-registry-url}</url>
204+
</snapshotRepository>
205+
</distributionManagement>
206+
</profile>
161207
<profile>
162208
<id>release-sign-artifacts</id>
163209
<activation>

pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -287,17 +287,6 @@
287287
<!-- This is the parent, so only define pluginManagement, not plugins. -->
288288
<pluginManagement>
289289
<plugins>
290-
<plugin>
291-
<groupId>org.sonatype.plugins</groupId>
292-
<artifactId>nexus-staging-maven-plugin</artifactId>
293-
<version>1.7.0</version>
294-
<extensions>true</extensions>
295-
<configuration>
296-
<serverId>ossrh</serverId>
297-
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
298-
<autoReleaseAfterClose>${deploy.autorelease}</autoReleaseAfterClose>
299-
</configuration>
300-
</plugin>
301290
<plugin>
302291
<artifactId>maven-assembly-plugin</artifactId>
303292
<version>3.7.1</version>
@@ -576,10 +565,6 @@
576565
</execution>
577566
</executions>
578567
</plugin>
579-
<plugin>
580-
<groupId>org.sonatype.plugins</groupId>
581-
<artifactId>nexus-staging-maven-plugin</artifactId>
582-
</plugin>
583568
<plugin>
584569
<groupId>com.coveo</groupId>
585570
<artifactId>fmt-maven-plugin</artifactId>

samples/dailymotion-simple-cmdline-sample/pom.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
<name>Simple example for the Dailymotion API.</name>
1212

1313
<build>
14+
<pluginManagement>
15+
<plugins>
16+
<plugin>
17+
<groupId>org.sonatype.plugins</groupId>
18+
<artifactId>nexus-staging-maven-plugin</artifactId>
19+
<configuration>
20+
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
21+
</configuration>
22+
</plugin>
23+
</plugins>
24+
</pluginManagement>
1425
<plugins>
1526
<plugin>
1627
<groupId>org.codehaus.mojo</groupId>
@@ -55,13 +66,6 @@
5566
<skip>true</skip>
5667
</configuration>
5768
</plugin>
58-
<plugin>
59-
<groupId>org.sonatype.plugins</groupId>
60-
<artifactId>nexus-staging-maven-plugin</artifactId>
61-
<configuration>
62-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
63-
</configuration>
64-
</plugin>
6569
</plugins>
6670
<finalName>${project.artifactId}-${project.version}</finalName>
6771
</build>

samples/pom.xml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,25 @@
3434
</modules>
3535

3636
<build>
37-
<plugins>
38-
<plugin>
39-
<groupId>org.apache.maven.plugins</groupId>
40-
<artifactId>maven-deploy-plugin</artifactId>
41-
<version>3.1.3</version>
42-
<configuration>
43-
<skip>true</skip>
44-
</configuration>
45-
</plugin>
46-
<plugin>
47-
<groupId>org.sonatype.plugins</groupId>
48-
<artifactId>nexus-staging-maven-plugin</artifactId>
49-
<version>1.7.0</version>
50-
<configuration>
51-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
52-
</configuration>
53-
</plugin>
54-
</plugins>
37+
<pluginManagement>
38+
<plugins>
39+
<plugin>
40+
<groupId>org.apache.maven.plugins</groupId>
41+
<artifactId>maven-deploy-plugin</artifactId>
42+
<version>3.1.3</version>
43+
<configuration>
44+
<skip>true</skip>
45+
</configuration>
46+
</plugin>
47+
<plugin>
48+
<groupId>org.sonatype.plugins</groupId>
49+
<artifactId>nexus-staging-maven-plugin</artifactId>
50+
<version>1.7.0</version>
51+
<configuration>
52+
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
53+
</configuration>
54+
</plugin>
55+
</plugins>
56+
</pluginManagement>
5557
</build>
5658
</project>

0 commit comments

Comments
 (0)