Adding a dependency when using Gradle with Eclipse


(Mike Mossey) #1

On macOS and Windows (same project attempted to develop on both).

I created an Eclipse project based on Gradle. I need to add commons lang as a dependency. I fiddled with adding various lines to the build.gradle, but it seems that Eclipse doesn’t “know” I modified it.

So first question, what is the proper line to add to build.gradle to add commons lang as a depedency?

Second question, how can I tell Eclipse to run Gradle to fetch and install the dependency, so that Eclipse knows it is there (and doesn’t give errors in my code like “unknown import”)?