How to update dependencies when working with gradle and git after switchting to a branch with different external dependencies?

(max payne) #1

Hi guys,

my question relates to Eclipse, Gradle and Git, primarly to Gradle and Git and the standard workflow one should use. For example, I’m in Eclipse working on something, than I switch the branch to another one with different external dependencies. So, my working tree gets replaced, including the build script. Eclipse tries to compile but will fail due to missing libraries.

What do I do now? Run some defined gradle task that fetches the libraries from the defined (e.g. maven-repo) and copies them into the suitable folders? And if so, do you guys automate that with some kind of “post-checkout-hook” defined for Git?


(Peter Niederwieser) #2

If you are using the Eclipse Gradle Tooling, you can right-click the project in Package Explorer and select Gradle->Refresh Dependencies. Might be nice to have an option for this to occur automatically.

( #3

That’s right. Also it would be nice to have dependencies refreshed after a pull. It’s really annoying to do this manually for all projects.