|
89 | 89 | </dependencyManagement>
|
90 | 90 | <build>
|
91 | 91 | <plugins>
|
92 |
| - <plugin> |
93 |
| - <groupId>org.sonatype.plugins</groupId> |
94 |
| - <artifactId>nexus-staging-maven-plugin</artifactId> |
95 |
| - <version>1.6.13</version> |
96 |
| - <extensions>true</extensions> |
97 |
| - <configuration> |
98 |
| - <serverId>sonatype-nexus-staging</serverId> |
99 |
| - <nexusUrl>https://google.oss.sonatype.org/</nexusUrl> |
100 |
| - <autoReleaseAfterClose>false</autoReleaseAfterClose> |
101 |
| - </configuration> |
102 |
| - </plugin> |
103 | 92 | <plugin>
|
104 | 93 | <artifactId>maven-javadoc-plugin</artifactId>
|
105 | 94 | <version>3.4.1</version>
|
|
134 | 123 | </build>
|
135 | 124 |
|
136 | 125 | <profiles>
|
| 126 | + <!-- Because the BOM artifact does not need to inherit other properties such as dependencies |
| 127 | + in the root pom.xml, this needs to define publication-related profiles. --> |
| 128 | + <profile> |
| 129 | + <!-- By default, we release artifacts to Sonatype, which requires |
| 130 | + nexus-staging-maven-plugin. --> |
| 131 | + <id>release-sonatype</id> |
| 132 | + <activation> |
| 133 | + <property> |
| 134 | + <!-- Only when we use the release-gcp-artifact-registry profile, |
| 135 | + which comes with artifact-registry-url property, this profile is |
| 136 | + turned off. --> |
| 137 | + <name>!artifact-registry-url</name> |
| 138 | + </property> |
| 139 | + </activation> |
| 140 | + <build> |
| 141 | + <plugins> |
| 142 | + <plugin> |
| 143 | + <groupId>org.sonatype.plugins</groupId> |
| 144 | + <artifactId>nexus-staging-maven-plugin</artifactId> |
| 145 | + <version>1.6.13</version> |
| 146 | + <extensions>true</extensions> |
| 147 | + <configuration> |
| 148 | + <serverId>sonatype-nexus-staging</serverId> |
| 149 | + <nexusUrl>https://google.oss.sonatype.org/</nexusUrl> |
| 150 | + <autoReleaseAfterClose>false</autoReleaseAfterClose> |
| 151 | + </configuration> |
| 152 | + </plugin> |
| 153 | + </plugins> |
| 154 | + </build> |
| 155 | + </profile> |
| 156 | + <profile> |
| 157 | + <!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying |
| 158 | + this release-gcp-artifact-registry profile: |
| 159 | + mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \ |
| 160 | + -Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/... |
| 161 | + --> |
| 162 | + <id>release-gcp-artifact-registry</id> |
| 163 | + <properties> |
| 164 | + <artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url> |
| 165 | + </properties> |
| 166 | + <distributionManagement> |
| 167 | + <repository> |
| 168 | + <id>gcp-artifact-registry-repository</id> |
| 169 | + <url>${artifact-registry-url}</url> |
| 170 | + </repository> |
| 171 | + <snapshotRepository> |
| 172 | + <id>gcp-artifact-registry-repository</id> |
| 173 | + <url>${artifact-registry-url}</url> |
| 174 | + </snapshotRepository> |
| 175 | + </distributionManagement> |
| 176 | + </profile> |
137 | 177 | <profile>
|
138 | 178 | <id>release-sign-artifacts</id>
|
139 | 179 | <activation>
|
|
0 commit comments