|
44 | 44 | <target>1.7</target> |
45 | 45 | </configuration> |
46 | 46 | </plugin> |
47 | | - <plugin> |
48 | | - <groupId>org.sonatype.plugins</groupId> |
49 | | - <artifactId>nexus-staging-maven-plugin</artifactId> |
50 | | - <version>1.6.8</version> |
51 | | - <extensions>true</extensions> |
52 | | - <configuration> |
53 | | - <serverId>ossrh</serverId> |
54 | | - <nexusUrl>https://google.oss.sonatype.org/</nexusUrl> |
55 | | - <autoReleaseAfterClose>true</autoReleaseAfterClose> |
56 | | - </configuration> |
57 | | - </plugin> |
58 | 47 | <plugin> |
59 | 48 | <groupId>org.apache.maven.plugins</groupId> |
60 | 49 | <artifactId>maven-source-plugin</artifactId> |
|
134 | 123 | </properties> |
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