|
110 | 110 | </dependencyManagement>
|
111 | 111 | <build>
|
112 | 112 | <plugins>
|
113 |
| - <plugin> |
114 |
| - <groupId>org.sonatype.plugins</groupId> |
115 |
| - <artifactId>nexus-staging-maven-plugin</artifactId> |
116 |
| - <version>1.7.0</version> |
117 |
| - <extensions>true</extensions> |
118 |
| - <configuration> |
119 |
| - <serverId>sonatype-nexus-staging</serverId> |
120 |
| - <nexusUrl>https://google.oss.sonatype.org/</nexusUrl> |
121 |
| - <autoReleaseAfterClose>false</autoReleaseAfterClose> |
122 |
| - </configuration> |
123 |
| - </plugin> |
124 | 113 | <plugin>
|
125 | 114 | <groupId>org.apache.maven.plugins</groupId>
|
126 | 115 | <artifactId>maven-javadoc-plugin</artifactId>
|
|
157 | 146 | </build>
|
158 | 147 |
|
159 | 148 | <profiles>
|
| 149 | + <!-- Because the BOM artifact does not need to inherit other properties such as dependencies |
| 150 | + in the root pom.xml, this needs to define publication-related profiles. --> |
| 151 | + <profile> |
| 152 | + <!-- By default, we release artifacts to Sonatype, which requires |
| 153 | + nexus-staging-maven-plugin. --> |
| 154 | + <id>release-sonatype</id> |
| 155 | + <activation> |
| 156 | + <property> |
| 157 | + <!-- Only when we use the release-gcp-artifact-registry profile, |
| 158 | + which comes with artifact-registry-url property, this profile is |
| 159 | + turned off. --> |
| 160 | + <name>!artifact-registry-url</name> |
| 161 | + </property> |
| 162 | + </activation> |
| 163 | + <build> |
| 164 | + <plugins> |
| 165 | + <plugin> |
| 166 | + <groupId>org.sonatype.plugins</groupId> |
| 167 | + <artifactId>nexus-staging-maven-plugin</artifactId> |
| 168 | + <version>1.6.13</version> |
| 169 | + <extensions>true</extensions> |
| 170 | + <configuration> |
| 171 | + <serverId>sonatype-nexus-staging</serverId> |
| 172 | + <nexusUrl>https://google.oss.sonatype.org/</nexusUrl> |
| 173 | + <autoReleaseAfterClose>false</autoReleaseAfterClose> |
| 174 | + </configuration> |
| 175 | + </plugin> |
| 176 | + </plugins> |
| 177 | + </build> |
| 178 | + </profile> |
| 179 | + <profile> |
| 180 | + <!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying |
| 181 | + this release-gcp-artifact-registry profile: |
| 182 | + mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \ |
| 183 | + -Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/... |
| 184 | + --> |
| 185 | + <id>release-gcp-artifact-registry</id> |
| 186 | + <properties> |
| 187 | + <artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url> |
| 188 | + </properties> |
| 189 | + <distributionManagement> |
| 190 | + <repository> |
| 191 | + <id>gcp-artifact-registry-repository</id> |
| 192 | + <url>${artifact-registry-url}</url> |
| 193 | + </repository> |
| 194 | + <snapshotRepository> |
| 195 | + <id>gcp-artifact-registry-repository</id> |
| 196 | + <url>${artifact-registry-url}</url> |
| 197 | + </snapshotRepository> |
| 198 | + </distributionManagement> |
| 199 | + </profile> |
160 | 200 | <profile>
|
161 | 201 | <id>release-sign-artifacts</id>
|
162 | 202 | <activation>
|
|
0 commit comments