【发布时间】:2016-06-12 19:00:26
【问题描述】:
可以看到服务托管成功了。
我的 gradle 脚本是这样的
group 'com.tinkering'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.8
repositories {
//mavenCentral()
maven{
url 'http://linkxserver:8081/nexus/content/repositories/central/'
//url 'http://localhost:8081/nexus/content/repositories/central/'
}
}
dependencies {
compile 'com.google.code.gson:gson:2.3.1'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
当我尝试运行 gradle 构建时,我收到了未知主机异常
$ ./gradlew clean build
:clean UP-TO-DATE
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve com.google.code.gson:gson:2.3.1.
Required by:
com.tinkering:gradletinker:1.0-SNAPSHOT
> Could not resolve com.google.code.gson:gson:2.3.1.
> Could not get resource 'http://linkxserver:8081/nexus/content/repositories/central/com/google/code/gson/gson/2.3.1/gson-2.3.1.pom'.
> Could not HEAD 'http://linkxserver:8081/nexus/content/repositories/central/com/google/code/gson/gson/2.3.1/gson-2.3.1.pom'. Received status code 502 from server: internal error - server connection terminated
我在http://linkxserver:8081/nexus/content/repositories/central/com/google/code/gson/gson/2.3.1/gson-2.3.1.pom 上做了一个卷曲,然后把 pom 拿回来了。
我已经设置了代理服务器,并且我有以下存储库配置设置:
我在本地机器上执行了完全相同的步骤,并且工作正常:-(
更新:“浏览存储”选项卡显示了 pom,但不显示下载的任何 jar 文件。
【问题讨论】:
-
将该网址放入浏览器,看看是否可以下载 pom 文件。
-
Curl'd 并得到了 pom 作为响应。我已经用另一个快照更新了这个问题。
-
我会检查服务器的配置并访问原因
Received status code 502 from server: internal error这看起来很奇怪......