【发布时间】:2015-04-26 09:55:24
【问题描述】:
我正在创建一个脚本插件来引用包含我的 orgs gradle 插件的 ivy 存储库。我现在的代码是:
repository.gradle
repositories {
ivy {
credentials {
username = artifactory_user
password = artifactory_password
}
url 'https://ourUrl/artifactory/repoName'
layout "pattern", {
ivy '[organization]/[module]/[revision]/ivy-[revision].xml'
artifact '[organisation]/[module]/[revision]/[artifact]-[revision].[ext]'
}
}
}
然后,在 build.gradle 文件中,
build.gradle
buildscript {
apply from: https://ourUrl/assets/repository.gradle, to: buildscript
dependencies { classpath group: 'ourGrp', name: 'artifactName', version: '1.0.0' }
}
在我的 gradle.properties 文件中:
gradle.properties
artifactory_user=username
artifactory_password=password
我收到的错误信息是这样的:
What went wrong:
A problem occurred evaluating script.
Could not find property 'artifactory_user' on Credentials [username: null].
关于如何解决此问题的任何建议?如果可能的话,我想避免对 build.gradle 文件产生任何进一步的影响。
【问题讨论】:
-
您可以尝试用
project. artifactory_user引用artifactory_user吗? -
gradle.properties 文件位于我的 Gradle 用户主目录中,而不是项目主目录中。我已经确认使用 --info 在构建中正确获取了 gradle 用户主页。
-
好的,刚刚尝试更改为,我收到消息:在凭据 [用户名:null] 上找不到属性“项目”。
标签: gradle ivy artifactory