Announcement Announcement Module
Collapse
No announcement yet.
20+ hours to populate model & build Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 20+ hours to populate model & build

    I'm using eclipse Juno with gradle1.4 set in the preferences.
    I have proxy settings in a gradle.properties file.
    The project builds 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.
    After the 20+ hours the build was successful! So I exited eclipse, thinking that as the workspace is saved, the gradle dependencies would also be persisted.
    When I re-opened eclipse, it said "Gradle Dependencies (uninitialized)", so this set off another "Get model...."

    I have 2 questions.
    1. Why is it taking 20+ hours to populate the model as the jar files have already been downloaded?
    Is there some debugging that I can do to find out what's going on?
    2. Is there a way to force eclipse to 'persist' the Gradle dependencies, so if I have to wait for the initial 20+ hours to populate the model that it just happens once?

    Thanks,

    Lynda

  • #2
    > 1. Why is it taking 20+ hours to populate the model as the jar files have already been downloaded?
    > Is there some debugging that I can do to find out what's going on?

    Unfortunately I can't really help you with that. The model actually gets built by Gradle not the STS Gradle Tools, STS merely request the model by calling Gradle through the tooling API. So the best place to get help on diagnosing this would be the Gradle Forum[*].

    If I had to make a guess, perhaps it could be because your project has a lot of dependencies that are not to specific version but to snapshot style dependency. In that case Gradle may be hitting the network a lot to try and verify you have the latest versions.

    > 2. Is there a way to force eclipse to 'persist' the Gradle dependencies, so if I have to wait for the initial 20+ hours to populate
    > the model that it just happens once?

    It should be caching the dependencies automatically. Maybe the dependencies don't get persisted if, for some reason, the workspace did not shutdown cleanly. If the shutdown was 'clean' (i.e not a crash or forceful process termination) and it didn't get persisted then that should probably be called a 'bug'. What version of the tooling are you using?

    One way you may be able to have more control over when the model builds happen is by disabling 'Dependency Management' via the Gradle context menu on the project. This will remove the 'Gradle Dependencies' container from your project and only run the 'eclipse' Gradle task instead to generate the .classpath. I think that will remove the 'automatic model build trigger' from your project. You would have to use menu "Gradle >> Refresh All" to regenerate eclipse configs, including classpath.

    Probably the 'Refresh All' will still incur a model build though, so that may take 20 hours in your case.

    Kris
    [*] = http://forums.gradle.org/gradle

    Comment


    • #3
      I've been in contact with Gradle.
      http://forums.gradle.org/gradle/topi...ild_in_eclipse

      So far we've managed to figure out that the proxy settings are being passed by eclipse to Gradle.
      The build works on the command line, because proxy settings aren't 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 taking 30mins per jar
      The class sts is calling seems to be "org.gradle.api.internal.externalresource.transpor t.http.JavaSystemPropertiesHttpProxySettings"
      Where is sts finding these settings??

      Thanks,

      Lynda

      Comment


      • #4
        Hi Lynda,

        That is all interesting and useful information. I am a bit surprised Eclipse/STS is passing proxy settings to the Gradle process because the process is launched via the Gradle tooling API rather than the usual Eclipse launching framework.

        There are a few things that you can check. First thing to check is proxy settings in Eclipse (although I think wiping your workspace metadata should have cleared those out, it is still worth checking). Go to "Window >> Preferences >> General >> Network Settings".

        I think you have to set this to 'Direct' to disable proxies. This configures proxies for the Eclipse process itself but I suppose it is possible that somehow the Gradle tooling API picks these up somehow from system properties and passes them on to the gradle process doing your builds.

        Second thing to check is if maybe Java system properties related to proxies are being set when Eclipse/STS launches.
        This depends a little on how you start STS/Eclipse. E.g. on Linux there is an STS.ini or eclipse.ini file in the directory where STS / Eclipse is installed. This contains the arguments to launch Eclipse with. If it is hard to figure out where your installation of STS/Eclipse is getting its startup arguments then a useful tool is 'visualvm'[*]. When you start it, it will show you a list of all the current JVM processes running on your machine and you can look at the exact arguments and system properties it was started with. The Eclipse STS process will probably be called something like 'Equinox launcher'. You can also use it to check the system props and arguments for the started Gradle daemon.

        Another thing to check is maybe some os environment variables. Though I gather you already did that from what you said earlier.

        Let me know how it goes,

        Kris
        [*] http://visualvm.java.net/

        Comment


        • #5
          Hi Kris,

          It was the Network Connections in the Eclipse preference settings. It was set to Manual. I've now changed it to Direct & it works!

          Thanks,

          Lynda

          Comment


          • #6
            That's good news! Thanks for letting me know.

            Kris

            Comment

            Working...
            X