Gradle 无法访问nexus repo以下载依赖项
我可以看到该服务已成功托管 我的gradle脚本如下所示Gradle 无法访问nexus repo以下载依赖项,gradle,maven-2,nexus,Gradle,Maven 2,Nexus,我可以看到该服务已成功托管 我的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/repos
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文件
您必须在
setting.xml中设置代理并添加
<proxy>
<id> MyId </id>
<active>true</active>
<protocol>http</protocol>
<host>yourAdress</host>
<port>yourPort</port>
</proxy>
粘虫
您必须在setting.xml中设置代理并添加
<proxy>
<id> MyId </id>
<active>true</active>
<protocol>http</protocol>
<host>yourAdress</host>
<port>yourPort</port>
</proxy>
粘虫
将该url放入浏览器,看看是否可以下载pom文件。Curl'd并将pom作为响应返回。我已使用另一个快照更新了问题。我将检查服务器的配置并访问原因从服务器接收到状态代码502:内部错误
这看起来很奇怪…将该url放入浏览器并查看是否可以下载pom文件.Curl'd并将pom作为响应返回。我已使用另一个快照更新了问题。我将检查服务器的配置并访问原因从服务器收到的状态代码502:内部错误这看起来很奇怪。。。