File tree Expand file tree Collapse file tree
src/main/groovy/org/apache/beam/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ fun checkMavenCentralAccessibility(): Boolean {
2222 val testUrl = " https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.pom"
2323 return try {
2424 val connection = URL (testUrl).openConnection() as HttpURLConnection
25- connection.requestMethod = " HEAD"
25+ connection.requestMethod = " GET"
26+ connection.setRequestProperty(" User-Agent" , " Gradle" )
2627 connection.connectTimeout = 2000
2728 connection.readTimeout = 2000
2829 connection.useCaches = false
@@ -33,7 +34,7 @@ fun checkMavenCentralAccessibility(): Boolean {
3334}
3435
3536val isMavenAccessible = checkMavenCentralAccessibility()
36- val mavenCentralMirrorUrl = " https://maven-central.storage-api .googleapis.com/repos/central/data /"
37+ val mavenCentralMirrorUrl = " https://maven-central.storage-download .googleapis.com/maven2 /"
3738
3839// Plugins for configuring _this build_ of the module
3940plugins {
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ class Repositories {
3434 try {
3535 def url = new URL (testUrl)
3636 def connection = (HttpURLConnection ) url. openConnection()
37- connection. requestMethod = " HEAD"
37+ connection. requestMethod = " GET"
38+ connection. setRequestProperty(" User-Agent" , " Gradle" )
3839 connection. connectTimeout = 2000
3940 connection. readTimeout = 2000
4041 connection. useCaches = false
@@ -63,7 +64,7 @@ class Repositories {
6364 mavenCentral()
6465 } else {
6566 project. logger. lifecycle " Maven Central is not accessible. Redirecting to Google Maven Mirror."
66- maven { url " https://maven-central.storage-api .googleapis.com/repos/central/data /" }
67+ maven { url " https://maven-central.storage-download .googleapis.com/maven2 /" }
6768 }
6869 mavenLocal()
6970
@@ -100,7 +101,7 @@ class Repositories {
100101 mavenCentral()
101102 maven { url " https://plugins.gradle.org/m2/" }
102103 } else {
103- maven { url " https://maven-central.storage-api .googleapis.com/repos/central/data /" }
104+ maven { url " https://maven-central.storage-download .googleapis.com/maven2 /" }
104105 }
105106 maven { url " https://repo.spring.io/plugins-release" }
106107 maven { url " https://packages.confluent.io/maven/" }
Original file line number Diff line number Diff line change @@ -20,15 +20,16 @@ import com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionW
2020pluginManagement {
2121 val isMavenAccessible = try {
2222 val connection = java.net.URL (" https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.pom" ).openConnection() as java.net.HttpURLConnection
23- connection.requestMethod = " HEAD"
23+ connection.requestMethod = " GET"
24+ connection.setRequestProperty(" User-Agent" , " Gradle" )
2425 connection.connectTimeout = 2000
2526 connection.readTimeout = 2000
2627 connection.useCaches = false
2728 connection.responseCode == 200
2829 } catch (e: Exception ) {
2930 false
3031 }
31- val mavenCentralMirrorUrl = " https://maven-central.storage-api .googleapis.com/repos/central/data /"
32+ val mavenCentralMirrorUrl = " https://maven-central.storage-download .googleapis.com/maven2 /"
3233
3334 repositories {
3435 if (isMavenAccessible) {
You can’t perform that action at this time.
0 commit comments