Hey folks. Is it possible to have different reposi...
# gradle
h
Hey folks. Is it possible to have different repositories configured for different environments?
The reason for this is: On a project I am supporting right now, we use a build environment provided by our client. It is rather restrictive. But they also provide an Artifactory with mirrors. Now, this Artifactory is accessible via VPN and proxy only. What I am trying to achieve is to use the official JCenter and Maven Central repos in the normal builds and the Artifactory mirrors on the build server
s
Sure
Copy code
repositories {
    if(clientEnvironment){
        clientRepository()
    }
    else ...
}
Just see your buildscript as regular code and Gradle as framework.
h
Awesome. A colleague of mine just recommended this as well literally a minute ago. Will do!
Thanks for the quick reply
s
☺️ No problem. Have fun coding with Gradle 👍