Getting started - two environments


(Martin Flower) #1

I’m picking up a project a colleague has started (Geb functional tests). I’m returning to Gradle after a two year break, so please pardon my ignorance.

I have two objectives

The project runs in Eclipse * Do I use the gradle wrapper, or do I install gradle (and force all other developers to install gradle) - as I understand things today, wrapper is the way to go * Do I use the eclipse Gradle plugin ? (I’ve installed it as part of latest STS) * No dependencies checked in - all dependencies to be sourced from Artifactory * Access to the internet is via a network proxy that requires authentication. If Artifactory can give me everything I need, can I avoid proxy access? I would prefer not to enter my network username and password in a configuration file (and force other developers to do the same). * Do I have a use for the Gradle Artifactory plugin ?

The project runs in Jenkins * Jenkins has no access to the internet * Jenkins does not have Gradle installed * Jenkins sources all its dependencies from Git and from Artifactory * Do we need to install the Jenkins Gradle plugin ?

I would have liked to watch the video on the wrapper, but YouTube is blocked on this corporate network, and on the iphone it doesn’t seem to work.


(Luke Daley) #2
  • Do I use the gradle wrapper, or do I install gradle (and force all other developers to install gradle) - as I understand things today, wrapper is the way to go

Definitely use the wrapper.

  • Do I use the eclipse Gradle plugin ? (I’ve installed it as part of latest STS)

You don’t have to, but it can be useful.

  • No dependencies checked in - all dependencies to be sourced from Artifactory

There is an Eclipse plugin for Gradle that makes support integration without the plugin

  • Access to the internet is via a network proxy that requires authentication. If Artifactory can give me everything I need, can I avoid proxy access? I would prefer not to enter my network username and password in a configuration file (and force other developers to do the same).

Yes. Gradle won’t arbitrarily connect to the Internet. You should get everything from your Artifactory instance.

  • Do I have a use for the Gradle Artifactory plugin ?

No. It’s not required.

  • Jenkins has no access to the internet

As long as it can access your Artifactory instance you’ll be fine.

  • Jenkins does not have Gradle installed

The wrapper solves this problem.

  • Jenkins sources all its dependencies from Git and from Artifactory

Sure.

  • Do we need to install the Jenkins Gradle plugin ?

You don’t need to, but I would recommend it.

I would have liked to watch the video on the wrapper, but YouTube is blocked on this corporate network, and on the iphone it doesn’t seem to work.

That video isn’t hosted on YouTube. It’s on Amazon S3.


(Martin Flower) #3

Hi Luke - thanks for the detailed feedback!

Meanwhile, this project has been assigned to another colleague. I’ll pass the information on.

Cheers

/Martin


(Martin Flower) #4

I’m back on this project after an 11 month delay during which nothing substantial has happened.

I would like to build a war file on a Bamboo server (on Windows) which can only source its dependencies from the network Git and Artifactory. I would like to build using gradlew, but this seems to want to connect to the internet, and fails with

ConnectException: Connection refused: connect in org.gradle.wrapper.Download.downloadInternal(Download.java:56).

My understanding was the gradlew was checked in to Git - but it still needs something else?

Should I be telling gradlew to get its dependencies from Artifactory? What setting is required, and what needs to be in Artifactory?

Thanks

/Martin


(Peter Niederwieser) #5

‘gradlew’ is a bootstrapper that downloads the Gradle distribution. You can configure where the distribution is downloaded from in ‘gradle/gradle-wrapper.properties’. For additional information, see the “Gradle Wrapper” chapter in the Gradle User Guide.


(Martin Flower) #6

ok, done some more reading, and now understand the following

  • I check in the gradle wrapper into source control * this looks at gradle/wrapper/gradle-wrapper.properties for distributionUrl=http://services.gradle.org/distributions/gradle-1.10-bin.zip

and attempts to download the file. * I need to change this setting so that it goes to our local Artifactory instance * I need to add to make sure that gradle does not attempt to access Artifactory through the corporate proxy * I need to upload gradle-1.10-bin.zip to the Artifactory instance using a directory naming structure of my own choosing - there is no gradle standard * It is not possible for Artifactory to retrieve gradle-1.10-bin.zip for me, as it is not distributed through maven (or other repositories)

Back to me to progress this issue.


(Martin Flower) #7

Thanks Peter - didn’t see your answer earlier


(Martin Flower) #8

I have added gradle wrapper to Artifactory, and the zip file is available at the following location

distributionUrl=http://iaa44.papyrus.com/artifactory/simple/repo/gradle/gradle/1.10/gradle-1.10-all.zip

But it looks like Artifactory requires authentication. The authentication I have in build.gradle does not seem to be used for this resource. Any suggestions?


(Martin Flower) #9

I’ve checked the zip file into Git, and this seems to work consistently for a repeatable build.