Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins + Gradle Wrapper. How to add init.gradle settings to Jenkins

I've just started to use Jenkins for CI with Gradle build tool for my project. According to Jenkins Gradle Integration: Invoke Gradle vs. Use Gradle Wrapper options I should use Gradle wrapper, because I define custom maven URL in init.gradle.

Code below is init.gradle on my computer.

allprojects {
    buildscript.repositories {
        maven { url "url here" }
    }
    buildscript.configurations.all {
        resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    repositories {
        maven { url "url here" }
    }
}

How can I configure Jenkins to use this settings?

like image 391
addmeaning Avatar asked Sep 13 '25 18:09

addmeaning


1 Answers

I just added

--init-script "path to init.gradle"

into Gradle Switches field and it worked

like image 177
addmeaning Avatar answered Sep 15 '25 07:09

addmeaning