|
68 | 68 | </dependencyManagement>
|
69 | 69 |
|
70 | 70 | <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> |
71 | 86 | <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> |
83 | 87 | <plugin>
|
84 | 88 | <groupId>org.apache.maven.plugins</groupId>
|
85 | 89 | <artifactId>maven-javadoc-plugin</artifactId>
|
|
109 | 113 | </build>
|
110 | 114 |
|
111 | 115 | <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> |
112 | 158 | <profile>
|
113 | 159 | <id>release-sign-artifacts</id>
|
114 | 160 | <activation>
|
|
0 commit comments