简体   繁体   English

gradle build:repo1.maven.org:未知错误

[英]gradle build: repo1.maven.org: unknown error

I have a spring-boot app that I was able to start up the server in eclipse. 我有一个能够在Eclipse中启动服务器的spring-boot应用程序。 However, when I goto terminal and do gradle compile, here is the console log i am getting: 但是,当我转到终端并进行gradle编译时,这是我得到的控制台日志:

    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

I am not entirely sure why this is happening: it seems like it is having some issues with proxy server, but if I were to do wget I can get the files under repo1.maven... 我不完全确定为什么会这样:代理服务器似乎出现了一些问题,但是如果我要进行wget操作,则可以在repo1.maven下获取文件。

For reference, this is my build.gradle: 供参考,这是我的build.gradle:

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

Any idea why I can't build? 知道为什么我不能建造吗?

代理属性应按照docs中所述在gradle.properties文件中进行配置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Gradle 构建错误:无法从 https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml 加载 Maven 元数据 - Gradle Build Error: Unable to load Maven meta-data from https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml repo1.maven.org中缺少jar - Missing jar from repo1.maven.org Maven,拒绝访问:http://repo1.maven.org/maven2 - Maven, Access denied to: http://repo1.maven.org/maven2 经典错误:无法更新central | http://repo1.maven.org/maven2的索引 - Classic error: Unable to update index for central|http://repo1.maven.org/maven2 Maven无法从/到repo1.maven.org传输工件 - Maven Could not transfer artifact from/to repo1.maven.org Gradle 无法解析 org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE (repo1.maven.org: Nome o servizio sconosciuto) - Gradle Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE (repo1.maven.org: Nome o servizio sconosciuto) 未知主机'repo.maven.apache.org'。 您可能需要调整 Gradle 中的代理设置 - Unknown host 'repo.maven.apache.org'. You may need to adjust the proxy settings in Gradle 无法将工件 org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 从/到中央 (http://repo1.Z402C5D9AF6B270711EAZD70BEE574) - Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2) 在 maven-central (https://repo1.maven.org/maven2/) 中找不到工件 net.sf.jasperreports:liberation-fonts:jar:1.0 - Could not find artifact net.sf.jasperreports:liberation-fonts:jar:1.0 in maven-central (https://repo1.maven.org/maven2/) 如何解决 Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)? - How do I resolve Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM