Gradle global variable not in scope within buildscript

前端 未结 2 1552
独厮守ぢ
独厮守ぢ 2021-01-17 16:27

I have something like this in my top level build.gradle (Gradle 2.2)

ext.repo = \"https://my-artifactory-repo\"

buildscript {
    repositories          


        
2条回答
  •  不思量自难忘°
    2021-01-17 17:03

    This is happening because the buildscript {...} configuration closure is always evaluated first, so the property is not yet defined. A workaround would be to define the property outside of the build script, either by placing it in a gradle.properties file or via the command line.

提交回复
热议问题