Why does it take 20+ hours to populate model & build in Eclipse


(bren1lyn) #1

I’m using Eclipse Juno with gradle1.4 set in the preferences and an ivy repository. I have proxy settings in a gradle.properties file. The project builds successfully on the command line in a couple of seconds. The project is basic, it doesn’t contain sub-projects but it takes over 20 hours to populate the model & build. There are 40 dependent libraries, but I have transitive set to false for each and I have a fixed version specified for each jar. I’m just converting the projects to gradle from ant, so don’t want to remove jar files already included in the project.

I originally posted this in STS, but they’ve said to go back to you guys. http://forum.springsource.org/showthread.php?135609-20-hours-to-populate-model-amp-build

Any idea why this takes so long in eclipse? Can I turn something on to debug while the build is taking place?

Any ideas or help would be appreciated.

Thanks,

Lynda


#2

Wow, that a long time to wait! There are a few things you can try to help us track down what’s going on:

See how long it takes to build the eclipse model in Gradle:

  • add ‘apply plugin: ‘eclipse’’ to your project (if not already there) * Execute ‘gradle eclipse’ from the command line, and see how long it takes.

Run the build with ‘–info’ or ‘–debug’:

In either case, use a pastebin service to share the log output.

Any more details you can share about your actual build may help as well.


(bren1lyn) #3

Running gradle eclipse on the commandline ran in a couple of seconds. I added -debug to the program arguments under the preferences.

The output from 2 jar files being downloaded from the ivy repository can be found at https://gist.github.com/anonymous/5193733

It looks as if it takes 1/2 hour for each file to download!

My gradle.properties has the following org.gradle.java.home=D:/java/jdk/jdk1.6.0_02 systemProp.http.proxyHost=intproxrr.sliderc.nsw.gov.au systemProp.http.proxyPort=8080 systemProp.http.proxyUser=NSWPS/999999 systemProp.http.proxyPassword=xxxxxxxx systemProp.http.auth.preference=Basic systemProp.http.auth.ntlm.domain=NSWPS

systemProp.https.proxyHost=intproxrr.sliderc.nsw.gov.au systemProp.https.proxyPort=8080 systemProp.https.proxyUser=NSWPS/999999 systemProp.https.proxyPassword=xxxxxxxx systemProp.https.auth.preference=Basic systemProp.https.auth.ntlm.domain=NSWPS

http.proxyHost=intproxrr.sliderc.nsw.gov.au http.proxyPort=8080 http.proxyUser=NSWPS/999999 http.proxyPassword=xxxxxxxx http.auth.preference=Basic http.auth.ntlm.domain=NSWPS

https.proxyHost=intproxrr.sliderc.nsw.gov.au https.proxyPort=8080 https.proxyUser=NSWPS/999999 https.proxyPassword=xxxxxxxx https.auth.preference=Basic https.auth.ntlm.domain=NSWPS

In Eclipse Window->Preferences->Gradle->Arguments Under the JVM Arguments

Use is selected with the following set

http.proxyHost=intproxrr.sliderc.nsw.gov.au http.proxyPort=8080 http.proxyUser=NSWPS/999999 http.proxyPassword=xxxxxxxx https.proxyHost=intproxrr.sliderc.nsw.gov.au https.proxyPort=8080 https.proxyUser=NSWPS/999999 https.proxyPassword=xxxxxxxx

It is missing the http.auth.preference and the http.auth.ntlm.domain

Lynda


#4

So the following HTTP request is timing out after 30 minutes.

http://java-build.sliderc.nsw.gov.au/ivy/repo/org.hibernate/hibernate-annotations/3.2.0.ga/sources/hibernate-annotations-3.2.0.ga.jar

Since the request fails, Gradle doesn’t cache this result, and tries again the next time you run the build. (Repository errors like this are treated as transient).

So that explains what’s going wrong. But I don’t understand why this doesn’t affect you when running Gradle from the command-line. A few things to might help:

  • The output of ‘gradle --debug eclipse’. Only the output as far as resolving the hibernate-annotations sources jar is necessary. - The output of ‘gradle --debug --refresh-dependencies eclipse’, as above.

(bren1lyn) #5

I’ve managed to figure out what the problem is but not why it’s happening. The dependencies aren’t resolved when the proxy server is being used. So when I tried to build from the command line it FAILED!

When I removed the proxy settings from the command line everything worked!

But getting back to eclipse… it’s still fails despite not having proxy settings set! I’ve cleaned/deleted everything I could think off gradle.properties files, .metadata directory, .gradle directories, deleted the cache, remove all JVM arguments under Windows->Preferences->Gradle. Checked my environment system path, proxy settings aren’t set anywhere.

Yet when I run Gradle->RefreshAll in eclipse. It finds & sets the proxy settings which is why it is failing.

Both of the following builds were done without the gradle.properties, so no proxy settings I’ve attached 2 log files,

the 1st is from running gradle -debug -eclipse on the command line

the 2nd from running eclipse->Gradle->RefreshAll

https://gist.github.com/anonymous/61c9754f9d89022ea5c0

Can you tell me where it’s reading the settings for in the eclipse build?

Thanks,

Lynda


#6

So somehow your proxy system properties are being set when executing Gradle through eclipse.

13:45:29.063 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.JavaSystemPropertiesHttpProxySettings] Found java system property ‘http.nonProxyHosts’: *.sliderc.nsw.gov.au|localhost|127.0.0.1. Will ignore proxy settings for these hosts.

Looks like you’ve eliminated all of the locations that Gradle might find these values directly, so my suspicion is that Eclipse is finding these properties somewhere, and passing them to Gradle.

Sorry to handball this, but the best place to find out where these values are coming from is probably the STS team. Perhaps you can go back to your original enquiry?

Please keep us informed about what you find out. Sorry I can’t be of more assistance.


(bren1lyn) #7

Hi Daz,

In Eclipse, under Window->Preferences->General->Network Connections

If you have the Active Provider set to Manual with the proxy settings listed then these are somehow passed to Gradle. If you change the Active Provider to Direct it works as expected in eclipse.

Thanks for your help.

Lynda


#8

Thanks for the follow-up. Might prove helpful to somebody else experiencing issues in Eclipse.