|
225 | 225 | <build> |
226 | 226 | <pluginManagement> |
227 | 227 | <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> |
239 | 228 | <plugin> |
240 | 229 | <groupId>org.apache.maven.plugins</groupId> |
241 | 230 | <artifactId>maven-deploy-plugin</artifactId> |
|
331 | 320 | </executions> |
332 | 321 |
|
333 | 322 | </plugin> |
334 | | - |
335 | | - <plugin> |
336 | | - <groupId>org.sonatype.plugins</groupId> |
337 | | - <artifactId>nexus-staging-maven-plugin</artifactId> |
338 | | - </plugin> |
339 | 323 | <plugin> |
340 | 324 | <groupId>org.apache.maven.plugins</groupId> |
341 | 325 | <artifactId>maven-deploy-plugin</artifactId> |
|
345 | 329 |
|
346 | 330 | <profiles> |
347 | 331 |
|
| 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 | + |
348 | 382 | <profile> |
349 | 383 | <id>default</id> |
350 | 384 | <activation> |
|
0 commit comments