|
99 | 99 | </plugin> |
100 | 100 | </plugins> |
101 | 101 | </pluginManagement> |
102 | | - <plugins> |
103 | | - <plugin> |
104 | | - <groupId>org.sonatype.plugins</groupId> |
105 | | - <artifactId>nexus-staging-maven-plugin</artifactId> |
106 | | - </plugin> |
107 | | - </plugins> |
| 102 | + <extensions> |
| 103 | + <extension> |
| 104 | + <!-- |
| 105 | + Enables the "artifactregistry://" URL scheme (go/airlock/howto_maven). |
| 106 | + Note that Maven extensions cannot be included in profiles ( |
| 107 | + https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms) |
| 108 | + --> |
| 109 | + <groupId>com.google.cloud.artifactregistry</groupId> |
| 110 | + <artifactId>artifactregistry-maven-wagon</artifactId> |
| 111 | + <version>2.2.3</version> |
| 112 | + </extension> |
| 113 | + </extensions> |
108 | 114 | </build> |
109 | 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> |
110 | 158 | <profile> |
111 | 159 | <id>release</id> |
112 | 160 | <activation> |
|
0 commit comments