Skip to content

Commit 14e7416

Browse files
authored
chore: profile to avoid using nexus-staging-maven-plugin (#27632)
1 parent c392a8c commit 14e7416

File tree

7 files changed

+343
-77
lines changed

7 files changed

+343
-77
lines changed

generator/src/googleapis/codegen/languages/java/1.26.0/templates/_pom_xml.tmpl

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@
4444
<target>1.6</target>
4545
</configuration>
4646
</plugin>
47-
<plugin>
48-
<groupId>org.sonatype.plugins</groupId>
49-
<artifactId>nexus-staging-maven-plugin</artifactId>
50-
<version>1.6.5</version>
51-
<extensions>true</extensions>
52-
<configuration>
53-
<serverId>ossrh</serverId>
54-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
55-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
56-
</configuration>
57-
</plugin>
5847
<plugin>
5948
<groupId>org.apache.maven.plugins</groupId>
6049
<artifactId>maven-source-plugin</artifactId>
@@ -116,6 +105,55 @@
116105
</properties>
117106

118107
<profiles>
108+
<profile>
109+
<!-- By default, we release artifacts to Sonatype, which requires
110+
nexus-staging-maven-plugin. -->
111+
<id>release-sonatype</id>
112+
<activation>
113+
<property>
114+
<!-- Only when we use the release-gcp-artifact-registry profile,
115+
which comes with artifact-registry-url property, this profile is
116+
turned off. -->
117+
<name>!artifact-registry-url</name>
118+
</property>
119+
</activation>
120+
<build>
121+
<plugins>
122+
<plugin>
123+
<groupId>org.sonatype.plugins</groupId>
124+
<artifactId>nexus-staging-maven-plugin</artifactId>
125+
<version>1.6.13</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>
133+
</plugins>
134+
</build>
135+
</profile>
136+
<profile>
137+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
138+
this release-gcp-artifact-registry profile:
139+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
140+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
141+
-->
142+
<id>release-gcp-artifact-registry</id>
143+
<properties>
144+
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url>
145+
</properties>
146+
<distributionManagement>
147+
<repository>
148+
<id>gcp-artifact-registry-repository</id>
149+
<url>${artifact-registry-url}</url>
150+
</repository>
151+
<snapshotRepository>
152+
<id>gcp-artifact-registry-repository</id>
153+
<url>${artifact-registry-url}</url>
154+
</snapshotRepository>
155+
</distributionManagement>
156+
</profile>
119157
<profile>
120158
<id>release-sign-artifacts</id>
121159
<activation>

generator/src/googleapis/codegen/languages/java/1.27.0/templates/_pom_xml.tmpl

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@
4444
<target>1.6</target>
4545
</configuration>
4646
</plugin>
47-
<plugin>
48-
<groupId>org.sonatype.plugins</groupId>
49-
<artifactId>nexus-staging-maven-plugin</artifactId>
50-
<version>1.6.5</version>
51-
<extensions>true</extensions>
52-
<configuration>
53-
<serverId>ossrh</serverId>
54-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
55-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
56-
</configuration>
57-
</plugin>
5847
<plugin>
5948
<groupId>org.apache.maven.plugins</groupId>
6049
<artifactId>maven-source-plugin</artifactId>
@@ -116,6 +105,55 @@
116105
</properties>
117106

118107
<profiles>
108+
<profile>
109+
<!-- By default, we release artifacts to Sonatype, which requires
110+
nexus-staging-maven-plugin. -->
111+
<id>release-sonatype</id>
112+
<activation>
113+
<property>
114+
<!-- Only when we use the release-gcp-artifact-registry profile,
115+
which comes with artifact-registry-url property, this profile is
116+
turned off. -->
117+
<name>!artifact-registry-url</name>
118+
</property>
119+
</activation>
120+
<build>
121+
<plugins>
122+
<plugin>
123+
<groupId>org.sonatype.plugins</groupId>
124+
<artifactId>nexus-staging-maven-plugin</artifactId>
125+
<version>1.6.13</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>
133+
</plugins>
134+
</build>
135+
</profile>
136+
<profile>
137+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
138+
this release-gcp-artifact-registry profile:
139+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
140+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
141+
-->
142+
<id>release-gcp-artifact-registry</id>
143+
<properties>
144+
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url>
145+
</properties>
146+
<distributionManagement>
147+
<repository>
148+
<id>gcp-artifact-registry-repository</id>
149+
<url>${artifact-registry-url}</url>
150+
</repository>
151+
<snapshotRepository>
152+
<id>gcp-artifact-registry-repository</id>
153+
<url>${artifact-registry-url}</url>
154+
</snapshotRepository>
155+
</distributionManagement>
156+
</profile>
119157
<profile>
120158
<id>release-sign-artifacts</id>
121159
<activation>

generator/src/googleapis/codegen/languages/java/1.28.0/templates/_pom_xml.tmpl

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@
4444
<target>1.7</target>
4545
</configuration>
4646
</plugin>
47-
<plugin>
48-
<groupId>org.sonatype.plugins</groupId>
49-
<artifactId>nexus-staging-maven-plugin</artifactId>
50-
<version>1.6.5</version>
51-
<extensions>true</extensions>
52-
<configuration>
53-
<serverId>ossrh</serverId>
54-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
55-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
56-
</configuration>
57-
</plugin>
5847
<plugin>
5948
<groupId>org.apache.maven.plugins</groupId>
6049
<artifactId>maven-source-plugin</artifactId>
@@ -115,6 +104,55 @@
115104
</properties>
116105

117106
<profiles>
107+
<profile>
108+
<!-- By default, we release artifacts to Sonatype, which requires
109+
nexus-staging-maven-plugin. -->
110+
<id>release-sonatype</id>
111+
<activation>
112+
<property>
113+
<!-- Only when we use the release-gcp-artifact-registry profile,
114+
which comes with artifact-registry-url property, this profile is
115+
turned off. -->
116+
<name>!artifact-registry-url</name>
117+
</property>
118+
</activation>
119+
<build>
120+
<plugins>
121+
<plugin>
122+
<groupId>org.sonatype.plugins</groupId>
123+
<artifactId>nexus-staging-maven-plugin</artifactId>
124+
<version>1.6.13</version>
125+
<extensions>true</extensions>
126+
<configuration>
127+
<serverId>sonatype-nexus-staging</serverId>
128+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
129+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
130+
</configuration>
131+
</plugin>
132+
</plugins>
133+
</build>
134+
</profile>
135+
<profile>
136+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
137+
this release-gcp-artifact-registry profile:
138+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
139+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
140+
-->
141+
<id>release-gcp-artifact-registry</id>
142+
<properties>
143+
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</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>
118156
<profile>
119157
<id>release-sign-artifacts</id>
120158
<activation>

generator/src/googleapis/codegen/languages/java/1.29.2/templates/_pom_xml.tmpl

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@
4444
<target>1.7</target>
4545
</configuration>
4646
</plugin>
47-
<plugin>
48-
<groupId>org.sonatype.plugins</groupId>
49-
<artifactId>nexus-staging-maven-plugin</artifactId>
50-
<version>1.6.5</version>
51-
<extensions>true</extensions>
52-
<configuration>
53-
<serverId>ossrh</serverId>
54-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
55-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
56-
</configuration>
57-
</plugin>
5847
<plugin>
5948
<groupId>org.apache.maven.plugins</groupId>
6049
<artifactId>maven-source-plugin</artifactId>
@@ -115,6 +104,55 @@
115104
</properties>
116105

117106
<profiles>
107+
<profile>
108+
<!-- By default, we release artifacts to Sonatype, which requires
109+
nexus-staging-maven-plugin. -->
110+
<id>release-sonatype</id>
111+
<activation>
112+
<property>
113+
<!-- Only when we use the release-gcp-artifact-registry profile,
114+
which comes with artifact-registry-url property, this profile is
115+
turned off. -->
116+
<name>!artifact-registry-url</name>
117+
</property>
118+
</activation>
119+
<build>
120+
<plugins>
121+
<plugin>
122+
<groupId>org.sonatype.plugins</groupId>
123+
<artifactId>nexus-staging-maven-plugin</artifactId>
124+
<version>1.6.13</version>
125+
<extensions>true</extensions>
126+
<configuration>
127+
<serverId>sonatype-nexus-staging</serverId>
128+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
129+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
130+
</configuration>
131+
</plugin>
132+
</plugins>
133+
</build>
134+
</profile>
135+
<profile>
136+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
137+
this release-gcp-artifact-registry profile:
138+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
139+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
140+
-->
141+
<id>release-gcp-artifact-registry</id>
142+
<properties>
143+
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</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>
118156
<profile>
119157
<id>release-sign-artifacts</id>
120158
<activation>

generator/src/googleapis/codegen/languages/java/1.30.1/templates/_pom_xml.tmpl

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@
4444
<target>1.7</target>
4545
</configuration>
4646
</plugin>
47-
<plugin>
48-
<groupId>org.sonatype.plugins</groupId>
49-
<artifactId>nexus-staging-maven-plugin</artifactId>
50-
<version>1.6.5</version>
51-
<extensions>true</extensions>
52-
<configuration>
53-
<serverId>ossrh</serverId>
54-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
55-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
56-
</configuration>
57-
</plugin>
5847
<plugin>
5948
<groupId>org.apache.maven.plugins</groupId>
6049
<artifactId>maven-source-plugin</artifactId>
@@ -131,6 +120,55 @@
131120
</properties>
132121

133122
<profiles>
123+
<profile>
124+
<!-- By default, we release artifacts to Sonatype, which requires
125+
nexus-staging-maven-plugin. -->
126+
<id>release-sonatype</id>
127+
<activation>
128+
<property>
129+
<!-- Only when we use the release-gcp-artifact-registry profile,
130+
which comes with artifact-registry-url property, this profile is
131+
turned off. -->
132+
<name>!artifact-registry-url</name>
133+
</property>
134+
</activation>
135+
<build>
136+
<plugins>
137+
<plugin>
138+
<groupId>org.sonatype.plugins</groupId>
139+
<artifactId>nexus-staging-maven-plugin</artifactId>
140+
<version>1.6.13</version>
141+
<extensions>true</extensions>
142+
<configuration>
143+
<serverId>sonatype-nexus-staging</serverId>
144+
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
145+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
146+
</configuration>
147+
</plugin>
148+
</plugins>
149+
</build>
150+
</profile>
151+
<profile>
152+
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
153+
this release-gcp-artifact-registry profile:
154+
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
155+
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
156+
-->
157+
<id>release-gcp-artifact-registry</id>
158+
<properties>
159+
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url>
160+
</properties>
161+
<distributionManagement>
162+
<repository>
163+
<id>gcp-artifact-registry-repository</id>
164+
<url>${artifact-registry-url}</url>
165+
</repository>
166+
<snapshotRepository>
167+
<id>gcp-artifact-registry-repository</id>
168+
<url>${artifact-registry-url}</url>
169+
</snapshotRepository>
170+
</distributionManagement>
171+
</profile>
134172
<profile>
135173
<id>release-sign-artifacts</id>
136174
<activation>

0 commit comments

Comments
 (0)