首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >分级构建: repo1.maven.org:未知错误

分级构建: repo1.maven.org:未知错误
EN

Stack Overflow用户
提问于 2015-07-20 21:32:28
回答 1查看 4.3K关注 0票数 1

我有一个弹簧引导应用程序,我能够在eclipse中启动服务器。但是,当我进入终端并进行gradle编译时,下面是我得到的控制台日志:

代码语言:javascript
复制
    FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'springBootREST'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE.
     Required by:
         :springBootREST:unspecified
      > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE.
         > Could not get resource 'https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.2.5.RELEASE/spring-boot-gradle-plugin-1.2.5.RELEASE.pom'.
            > Could not HEAD 'https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.2.5.RELEASE/spring-boot-gradle-plugin-1.2.5.RELEASE.pom'.
               > repo1.maven.org: unknown error

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

我不完全确定为什么会发生这种情况:它似乎与代理服务器有一些问题,但是如果我要做wget,我可以将文件放在repo1.maven下。

供参考,这是我的build.gradle:

代码语言:javascript
复制
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE")
    }
}
// same as what is in my .bash_profile
systemProp.http.proxyHost='my proxy server'
systemProp.http.proxyPort='my proxy port'


apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'spring-boot'

group = 'lookupGroup'

jar {
    baseName = 'lookupService'
    version =  '0.1.0'
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE'
    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-starter-actuator")
    testCompile("org.springframework.boot:spring-boot-starter-test")
    testCompile("junit:junit")
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.3'
}

知道我为什么不能建房子吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-21 08:05:43

代理属性应该在gradle.properties文件中配置,如文档中所述。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31526720

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档