Skip to content

Commit d138023

Browse files
authored
fix: remove unnecessary nexus-staging-maven-plugin activation (googleapis#1665)
1 parent e53c441 commit d138023

File tree

5 files changed

+59
-27
lines changed

5 files changed

+59
-27
lines changed

appengine/pom.xml

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
<sourceDirectory>java</sourceDirectory>
2424
<testSourceDirectory>javatests</testSourceDirectory>
2525
<plugins>
26-
<plugin>
27-
<groupId>org.sonatype.plugins</groupId>
28-
<artifactId>nexus-staging-maven-plugin</artifactId>
29-
</plugin>
3026
<plugin>
3127
<groupId>org.apache.maven.plugins</groupId>
3228
<artifactId>maven-source-plugin</artifactId>

bom/pom.xml

+57-11
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,22 @@
6868
</dependencyManagement>
6969

7070
<build>
71+
<pluginManagement>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.sonatype.plugins</groupId>
75+
<artifactId>nexus-staging-maven-plugin</artifactId>
76+
<version>1.7.0</version>
77+
<extensions>true</extensions>
78+
<configuration>
79+
<serverId>ossrh</serverId>
80+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
81+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
82+
</configuration>
83+
</plugin>
84+
</plugins>
85+
</pluginManagement>
7186
<plugins>
72-
<plugin>
73-
<groupId>org.sonatype.plugins</groupId>
74-
<artifactId>nexus-staging-maven-plugin</artifactId>
75-
<version>1.7.0</version>
76-
<extensions>true</extensions>
77-
<configuration>
78-
<serverId>ossrh</serverId>
79-
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
80-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
81-
</configuration>
82-
</plugin>
8387
<plugin>
8488
<groupId>org.apache.maven.plugins</groupId>
8589
<artifactId>maven-javadoc-plugin</artifactId>
@@ -109,6 +113,48 @@
109113
</build>
110114

111115
<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>
112158
<profile>
113159
<id>release-sign-artifacts</id>
114160
<activation>

credentials/pom.xml

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
<sourceDirectory>java</sourceDirectory>
2323
<testSourceDirectory>javatests</testSourceDirectory>
2424
<plugins>
25-
<plugin>
26-
<groupId>org.sonatype.plugins</groupId>
27-
<artifactId>nexus-staging-maven-plugin</artifactId>
28-
</plugin>
2925
<plugin>
3026
<groupId>org.apache.maven.plugins</groupId>
3127
<artifactId>maven-source-plugin</artifactId>

oauth2_http/pom.xml

-4
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@
9999
</execution>
100100
</executions>
101101
</plugin>
102-
<plugin>
103-
<groupId>org.sonatype.plugins</groupId>
104-
<artifactId>nexus-staging-maven-plugin</artifactId>
105-
</plugin>
106102
<plugin>
107103
<groupId>org.apache.maven.plugins</groupId>
108104
<artifactId>maven-source-plugin</artifactId>

pom.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@
201201
<pluginManagement>
202202
<plugins>
203203
<plugin>
204+
<!-- nexus-staging-maven-plugin is activated by the release-sonatype
205+
profile defined in native-image-shared-config -->
204206
<groupId>org.sonatype.plugins</groupId>
205207
<artifactId>nexus-staging-maven-plugin</artifactId>
206208
<version>1.7.0</version>
@@ -283,10 +285,6 @@
283285
<encoding>UTF-8</encoding>
284286
</configuration>
285287
</plugin>
286-
<plugin>
287-
<groupId>org.sonatype.plugins</groupId>
288-
<artifactId>nexus-staging-maven-plugin</artifactId>
289-
</plugin>
290288
<plugin>
291289
<groupId>org.apache.maven.plugins</groupId>
292290
<artifactId>maven-source-plugin</artifactId>

0 commit comments

Comments
 (0)