Grade Unknown host 'services.gradle.org' error after entering proxy setting in Springboot

374 Views Asked by At

I am following the springboot starter here https://spring.io/guides/gs/spring-boot/ and using the starter code.

I am getting a ERROR: Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle. when I try to run gradle.

I have entered proxy information in user/.gradle/gradle.properties as documented here. https://docs.gradle.org/current/userguide/userguide_single.html#sec:accessing_the_web_via_a_proxy

I have also tried adding

classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
System.setProperty('http.proxyHost', 'proxy.companyproxy.com:8080') 

to my build.gradle file. I am using mac and terminal and intelliJ proxy are also configured. Why is the proxy not coming through for gradle? My build.gradle file: same as given in sample starter

plugins {
    id 'org.springframework.boot' version '2.3.3.RELEASE'
    id 'io.spring.dependency-management' version '1.0.8.RELEASE'
    id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

test {
    useJUnitPlatform()
}
0

There are 0 best solutions below