Skip to content

Commit 041dc41

Browse files
authored
Configure Maven to use repo1.maven.org mirror
Added a step to configure Maven to use repo1.maven.org as a mirror.
1 parent c0a7f3d commit 041dc41

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/maven-publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ jobs:
1717
server-id: sonatype-nexus-staging
1818
server-username: MAVEN_USERNAME
1919
server-password: MAVEN_PASSWORD
20+
- name: Force Maven to use repo1.maven.org
21+
run: |
22+
mkdir -p ~/.m2
23+
cat > ~/.m2/settings.xml <<'EOF'
24+
<settings>
25+
<mirrors>
26+
<mirror>
27+
<id>central-repo1</id>
28+
<mirrorOf>central</mirrorOf>
29+
<url>https://repo1.maven.org/maven2/</url>
30+
</mirror>
31+
</mirrors>
32+
</settings>
33+
EOF
2034
- name: Install GPG secret key
2135
run: |
2236
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import

0 commit comments

Comments
 (0)