当我在 Artifactory 中单击“设置我”时,会生成一个 gradle.properties 文件,如下所示:
artifactory_user=my_artifactory_user
artifactory_password=WAklvc9LXWDsVcoVILbKyebkQG5uBxos6rIrmi8HjMTB3xicLJbxstmEQwRwIoGN6pBnK3T91I
artifactory_contextUrl=https://artifactory.company.com/artifactory
但是,当我运行 ./gradlew artifactoryDeploy
我收到此错误:> Task :artifactoryDeploy FAILED
Could not build the build-info object.
org.jfrog.build.util.VersionException: Error occurred while requesting version information: Response message: {
"errors" : [ {
"status" : 401,
"message" : "Bad credentials"
} ]
}
...
stacktrace
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':artifactoryDeploy'.
> java.io.IOException: Could not publish build-info: Error occurred while requesting version information: Response message: {
"errors" : [ {
"status" : 401,
"message" : "Bad credentials"
} ]
}
我很困惑,因为 Artifactory 正在生成此加密密码,但文档使用纯文本示例。https://www.jfrog.com/confluence/display/JFROG/Working+With+Gradle#WorkingwithGradle-ConfiguringGradle
是
artifactory_password
应该像这样加密还是应该是纯文本?
最佳答案
artifactory_password
参数可用于:
如果您收到 Bad credentials 错误,可能的原因之一是当 Artifactory 配置为 Password Encryption Policy 时使用了加密密码。设置为不支持(不考虑加密密码)。
你可以做一些事情来调试这个问题:
关于gradle - Gradle Artifactory 插件应该使用纯文本还是加密密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64209497/