fix: fixed the profile for Artifact Registry deployment#950
fix: fixed the profile for Artifact Registry deployment#950suztomo merged 1 commit intogoogleapis:mainfrom
Conversation
The java-shared-config repository was able to publish the artifacts to my Artifact Registry: mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \ -P=-release-staging-repository -Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
| <!-- Only when we use the release-gcp-artifact-registry profile, | ||
| which comes with artifact-registry-url property, this profile is | ||
| turned off. --> | ||
| <name>!artifact-registry-url</name> |
There was a problem hiding this comment.
I don't think it's possible to chain profile activations/deactivations like this.
https://stackoverflow.com/a/2248552
Are you able to verify this works?
There was a problem hiding this comment.
This is not chaining profile activation (this is not relying on the line 145).
This activation relies on the fact that when we publish artifacts to GCP Artifact Registry using release-gcp-artifact-registry profile, -Dartifact-registry-url=... is always passed to the mvn command.
There was a problem hiding this comment.
I'll verify it works in the Kokoro release job.
There was a problem hiding this comment.
Line 145 is dummy value that tells the property is undefined.
There was a problem hiding this comment.
I'll verify it works in the Kokoro release job.
The release of this repository and google-auth-library-java (googleapis/google-auth-library-java#1593) succeeded.
Defining the profile to publish artifacts to Artifact Registry.
The previous (reverted) attempt in #936 was wrong in that it missed this point when I used
<activeByDefault>true</activeByDefault>:from https://maven.apache.org/guides/introduction/introduction-to-profiles.html.
This pull request now turns on the release-sonatype profile unless the
artifact-registry-urlproperty is defined. The property artifact-registry-url is only used for Artifact Registry publication.Experiment
The java-shared-config repository was able to publish the artifacts to my Artifact Registry:
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype
-P=-release-staging-repository -Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
http://gpaste/5275049054175232