|
81 | 81 | </dependency> |
82 | 82 | </dependencies> |
83 | 83 | </dependencyManagement> |
84 | | - |
85 | 84 | <build> |
86 | | - <pluginManagement> |
87 | | - <plugins> |
88 | | - <plugin> |
89 | | - <groupId>org.sonatype.plugins</groupId> |
90 | | - <artifactId>nexus-staging-maven-plugin</artifactId> |
91 | | - <version>1.7.0</version> |
92 | | - <extensions>true</extensions> |
93 | | - <configuration> |
94 | | - <serverId>ossrh</serverId> |
95 | | - <nexusUrl>https://google.oss.sonatype.org/</nexusUrl> |
96 | | - <autoReleaseAfterClose>false</autoReleaseAfterClose> |
97 | | - <stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes> |
98 | | - </configuration> |
99 | | - </plugin> |
100 | | - </plugins> |
101 | | - </pluginManagement> |
102 | | - <plugins> |
103 | | - <plugin> |
104 | | - <groupId>org.sonatype.plugins</groupId> |
105 | | - <artifactId>nexus-staging-maven-plugin</artifactId> |
106 | | - </plugin> |
107 | | - </plugins> |
| 85 | + <extensions> |
| 86 | + <extension> |
| 87 | + <!-- |
| 88 | + Enables the "artifactregistry://" URL scheme in Artifact Registry (Airlock and ExitGate). |
| 89 | + Note that Maven extensions cannot be included in profiles ( |
| 90 | + https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms) |
| 91 | + --> |
| 92 | + <groupId>com.google.cloud.artifactregistry</groupId> |
| 93 | + <artifactId>artifactregistry-maven-wagon</artifactId> |
| 94 | + <version>2.2.3</version> |
| 95 | + </extension> |
| 96 | + </extensions> |
108 | 97 | </build> |
109 | 98 | <profiles> |
| 99 | + <profile> |
| 100 | + <!-- By default, we release artifacts to Sonatype, which requires |
| 101 | + nexus-staging-maven-plugin. --> |
| 102 | + <id>release-sonatype</id> |
| 103 | + <activation> |
| 104 | + <activeByDefault>true</activeByDefault> |
| 105 | + </activation> |
| 106 | + <build> |
| 107 | + <pluginManagement> |
| 108 | + <plugins> |
| 109 | + <plugin> |
| 110 | + <groupId>org.sonatype.plugins</groupId> |
| 111 | + <artifactId>nexus-staging-maven-plugin</artifactId> |
| 112 | + <version>1.7.0</version> |
| 113 | + <extensions>true</extensions> |
| 114 | + <configuration> |
| 115 | + <serverId>ossrh</serverId> |
| 116 | + <nexusUrl>https://google.oss.sonatype.org/</nexusUrl> |
| 117 | + <autoReleaseAfterClose>false</autoReleaseAfterClose> |
| 118 | + <stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes> |
| 119 | + </configuration> |
| 120 | + </plugin> |
| 121 | + </plugins> |
| 122 | + </pluginManagement> |
| 123 | + <plugins> |
| 124 | + <plugin> |
| 125 | + <groupId>org.sonatype.plugins</groupId> |
| 126 | + <artifactId>nexus-staging-maven-plugin</artifactId> |
| 127 | + </plugin> |
| 128 | + </plugins> |
| 129 | + </build> |
| 130 | + </profile> |
| 131 | + <profile> |
| 132 | + <!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying |
| 133 | + this release-gcp-artifact-registry profile: |
| 134 | +
|
| 135 | + mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \ |
| 136 | + -Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/... |
| 137 | + --> |
| 138 | + <id>release-gcp-artifact-registry</id> |
| 139 | + <activation> |
| 140 | + <activeByDefault>false</activeByDefault> |
| 141 | + </activation> |
| 142 | + <properties> |
| 143 | + <artifact-registry-url>artifactregistry://undefined-artifact-registry-url-value</artifact-registry-url> |
| 144 | + </properties> |
| 145 | + <distributionManagement> |
| 146 | + <repository> |
| 147 | + <id>gcp-artifact-registry-repository</id> |
| 148 | + <url>${artifact-registry-url}</url> |
| 149 | + </repository> |
| 150 | + <snapshotRepository> |
| 151 | + <id>gcp-artifact-registry-repository</id> |
| 152 | + <url>${artifact-registry-url}</url> |
| 153 | + </snapshotRepository> |
| 154 | + </distributionManagement> |
| 155 | + </profile> |
110 | 156 | <profile> |
111 | 157 | <id>release</id> |
112 | 158 | <activation> |
|
0 commit comments