Skip to content

Commit

Permalink
Updated the maven settings for artifact registry in GCP
Browse files Browse the repository at this point in the history
  • Loading branch information
biarca-shreya committed Apr 21, 2023
1 parent 98a45be commit 85ee41a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 24 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ stages:
before_install:
# Ensure the settings we want to use are in place before running the default mvn install
- cp ./travis/maven-settings.xml $HOME/.m2/settings.xml
- sed -i "s/-SNAPSHOT/-build-$TRAVIS_BUILD_NUMBER/" pom.xml
# Disable SourceClear except on scheduled builds
- |
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]
Expand Down
27 changes: 21 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,25 @@
</properties>

<distributionManagement>
<snapshotRepository>
<id>io.cloudrepo.rit-public-snapshot</id>
<url>https://susom.mycloudrepo.io/repositories/rit-public-snapshot</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>artifact-registry</id>
<url>https://us-west1-maven.pkg.dev/som-rit-infrastructure-prod/public-maven</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<id>artifact-registry</id>
<url>https://us-west1-maven.pkg.dev/som-rit-infrastructure-prod/public-maven</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -420,6 +429,12 @@
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
Expand Down
42 changes: 24 additions & 18 deletions travis/maven-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<mirrors>
<mirror>
<mirrorOf>*,!io.cloudrepo.rit-public-snapshot,!io.cloudrepo.rit-ext-private</mirrorOf>
<mirrorOf>*,!artifact-registry</mirrorOf>
<url>https://repo.maven.apache.org/maven2/</url>
</mirror>
</mirrors>
Expand All @@ -14,15 +14,8 @@
<id>travis-ci</id>
<repositories>
<repository>
<id>io.cloudrepo.rit-public-snapshot</id>
<url>https://susom.mycloudrepo.io/repositories/rit-public-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>io.cloudrepo.rit-ext-private</id>
<url>https://susom.mycloudrepo.io/repositories/rit-ext-private</url>
<id>artifact-registry</id>
<url>https://us-west1-maven.pkg.dev/som-rit-infrastructure-prod/public-maven</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
Expand Down Expand Up @@ -53,14 +46,27 @@

<servers>
<server>
<id>io.cloudrepo.rit-public-snapshot</id>
<username>${env.REPO_USERNAME}</username>
<password>${env.REPO_API_TOKEN}</password>
</server>
<server>
<id>io.cloudrepo.rit-ext-private</id>
<username>${env.REPO_USERNAME}</username>
<password>${env.REPO_API_TOKEN}</password>
<id>artifact-registry</id>
<configuration>
<httpConfiguration>
<get>
<usePreemptive>true</usePreemptive>
</get>
<head>
<usePreemptive>true</usePreemptive>
</head>
<put>
<params>
<property>
<name>http.protocol.expect-continue</name>
<value>false</value>
</property>
</params>
</put>
</httpConfiguration>
</configuration>
<username>_json_key_base64</username>
<password>${env.ARTIFACT_REGISTRY_KEY}</password>
</server>
<server>
<id>ossrh</id>
Expand Down

0 comments on commit 85ee41a

Please sign in to comment.