我目前正在尝试获取Gradle项目以使用公司的内部联系。 经过一番搜索,我发现以下方法可以工作:
repositories {
maven {
credentials {
username= 'MyName'
password= 'MyPass'
}
url 'https://company.com/repository/public/'
}
}
但是我不想兑现我的信用,所以我将其作为{1>放入我的~/.gradle/.gradle.properties
中:
nexusUsername=MyName
nexusPassword=MyPass
并将我的build.gradle
更改为:
repositories {
maven {
credentials {
username= project.ext["nexusUsername"]
password= project.ext["nexusPassword"]
}
url 'https://company.com/repository/public/'
}
}
这时服务器开始使用HTTP 401进行响应。 当我打印它们时,它们仍会出现,并且看起来完全一样。 为什么会发生这种情况,我该如何解决?