(improvement)(build) Fixed the issue of unable to download JDK on CentOS. (#1118)

This commit is contained in:
lexluo09
2024-06-09 11:10:15 +08:00
committed by GitHub
parent 915d4ec4c2
commit 9584d7bb2c
2 changed files with 16 additions and 3 deletions

View File

@@ -16,9 +16,20 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Java and Maven
- name: Reset DNF repositories
run: |
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: Update DNF package index
run: dnf makecache
- name: Install Java and Maven with retry
run: |
for i in {1..5}; do
dnf install -y java-1.8.0-openjdk-devel maven && break || sleep 15
done
- name: Verify Java and Maven installation
run: |
dnf install -y java-1.8.0-openjdk-devel maven
java -version
mvn -version
- name: Cache Maven packages