0
我正在創建一個腳本插件來引用持有我的orgs gradle插件的ivy存儲庫。我的代碼現在的問題是:無法在腳本插件中引用gradle.properties
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文件造成任何進一步的影響。
能不能請你參考'artifactory_user'用'項目。 artifactory_user'? – Opal 2015-02-24 17:17:15
** gradle.properties **文件位於我的Gradle用戶主目錄中,而不是項目主目錄。我已經確認,gradle用戶主頁正在使用--info在構建中正確拾取。 – JimmyMac 2015-02-24 17:28:20
好的,只是試圖改變,我得到的消息: 無法找到屬性'項目'憑證[用戶名:空]。 – JimmyMac 2015-02-24 17:31:51