0

我在这里https://spring.io/guides/gs/spring-boot/关注springboot启动器并使用启动器代码。

ERROR: Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle.当我尝试运行 gradle 时,我得到了一个。

我已经在 user/.gradle/gradle.properties 中输入了代理信息,如此处所述。https://docs.gradle.org/current/userguide/userguide_single.html#sec:accessing_the_web_via_a_proxy

我也尝试过添加

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') 

到我的 build.gradle 文件。我正在使用 mac,并且还配置了终端和 intelliJ 代理。为什么代理没有通过gradle?我的 build.gradle 文件:与示例启动器中给出的相同

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()
}
4

0 回答 0