Eclipse : How to set env variables for Gradle run

不羁的心 提交于 2021-01-27 17:13:33

问题


I am using the buildship plugin to build gradle projects. I need to use some env variables in my build script to connect to some external repositories. When i run the gradle build from command line, it works fine as I have the required env variables. I would like to run the build from eclipse.

I do not see an Environment tab in the run configuration window. How do i set env variables for gradle build in eclipse?

Here is where i need the env variables

repositories {
    mavenCentral()
    maven {
            def mvnRpoUrl = "https://some/url/1"
            url mvnRpoUrl

            credentials {
                username "$System.env.USER_ID1"
                password "$System.env.PASSWORD1"
            }
     }
     maven {
            def mvnRpoUrl = "https://some/other/url"
            url mvnRpoUrl

            credentials {
                username "$System.env.USER_ID2"
                password "$System.env.PASSWORD2"
        }
    }
}

来源:https://stackoverflow.com/questions/50860982/eclipse-how-to-set-env-variables-for-gradle-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!