0

I have a gradle project with gradle wrapper. For wrapper I have gradle-wrapper.properties with distributionUrl pointing to https://services.gradle.org/distributions/gradleXX-all.zip for local development.

In my Jenkis release pipelinee i don't have access to above repository, so I change distributionUrl to my company's server using:

gradle wrapper --gradle-distribution-url https://my-company.com/gradle/gradleXX.zip

For now everything's fine. Problem starts in next step when I use gradle-release plugin. It detects that gradle-wrapper.properties has been changed, and commits that back into my repository. I don't want that, since when i fetch this change and try to run build locally, it fails since locally I don't have access to repository I used in Jenkins.

Can you suggest a way to handle this situation properly? How to use different distributionUrl for local development and Jenkins pipelines? In Maven I would just use profiles and that would fix my problem, but i'm relatively new to Gradle and i'm not really able to come to a satisfactory solution.

Would appreciate any help, thanks in advance!

brtk
  • 65
  • 1
  • 6

1 Answers1

0

Ok i think i got it, in build.gradle in release task you can add commitVersionFileOnly in git config:

git {
        requireBranch = ''
        pushToRemote = 'origin'
        commitVersionFileOnly = true
        signTag = false
    }
brtk
  • 65
  • 1
  • 6