Announcement Announcement Module
Collapse
No announcement yet.
Gradle integration into Eclipse doesn't resolve dependencies Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gradle integration into Eclipse doesn't resolve dependencies

    I have eclipse 4.2.
    I installed the Gradle integration tool from Eclipse's marketplace.
    I removed the two optional dependencies.

    Then I create a "new project" > "Gradle Project".
    I fill the form: Project name = "abc" ; default location checked ; sample project = "Java Quickstart"
    I press "Finish"

    Then I wait 5 minutes for the script to start, then one more minute for the script to run. (I believe it's quite long, but I also believe this happens because of network issue, see below).

    When the project is finally created, I have from there 8 errors. I can probably narrow down to the two following errors:
    * Illegal entry in Gradle Dependencies: C:/Program Files/eclipse/unresolved dependency - commons-collections commons-collections 3.2
    * Illegal entry in Gradle Dependencies: C:/Program Files/eclipse/unresolved dependency - junit junit 4.+

    If I select the build.gradle file, I can see that the dependency management is enabled.

    I suppose it's a network error as I'm behind a proxy with authentication. Eclipse can connect to the Internet, but I suspect that Eclipse's Gradle can't. If it's the same as Maven, I need to configure Eclipse's Gradle to connect through my firewall. I just need to know how.

    So, is my assumption correct and if yes, how do I fix it, unless it's actually a bug?


    Thanks!

  • #2
    Probably you are correct about the proxy being the cause.

    The dependencies actually get downloaded by the Gradle Daemon that is executing the gradle build script. This is a separate process launched by Gradle tooling API. So you will have to tell gradle about proxies (so I think you got it all right so far :-).

    The information on how to tell gradle about proxies I think is here:

    http://www.gradle.org/docs/current/u...vironment.html

    See section 20.2

    Kris

    Comment


    • #3
      Thanks!

      Well, I'll need some help there. I'm new to Gradle. I have not installed Gradle separately from Eclipse. Where do I put the configuration files? Because it's an abolute no to me setting my proxy password in the build.gradle that will be put in a public repository.

      Also I'd like these settings be done globally for my eclipse configuration, not on a project basis.

      Comment


      • #4
        In the link I sent you there's this info at the top:

        The configuration is applied in following order (in case an option is configured in multiple locations the last one wins):

        from gradle.properties located in project build dir.
        from gradle.properties located in gradle user home.
        I have not tried this myself, but I think this translates to:

        you can put a file called 'gradle.properties' in your project (you may not like that option :-) or in your user's 'gradle home' directory. I.e. if my user is called 'ogregoire' and I'm on a unix style system then I can put that file in

        /home/ogregoire/.gradle/gradle.properties

        If that doesn't work, then you might also be able to set the properties via system property arguments of the form "-Dprop=value" inside the IDE on the preferences page at 'Window >> Preferences >> Gradle >> Arguments".

        Your best bet is probably via the /home/ogregoire/.gradle/gradle.properties

        So try that one first.

        Kris
        Last edited by Kris De Volder; Mar 4th, 2013, 07:40 PM.

        Comment


        • #5
          Great! It works!

          I had read it twice to find something like that and for some reason I simply skipped that part. Sorry for that.

          But thanks for the help provided!

          Comment


          • #6
            > ... I simply skipped that part

            No problem, it happens to all of us. Needles in haystacks :-).
            I'm glad it works for you.

            Kris

            Comment

            Working...
            X