Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle: IntelliJ like 'export' dependencies?

Is there an 'export' dependencies version of IntelliJ idea in gradle?

On IntelliJ IDEA if I have module A dependent on module B and module B dependent on module C, then module B's dependencies will only be exported to module A if exported is set to true.

I am currently writing a script to convert my IntelliJ projects to a Gradle project. How does Gradle handle transitive dependencies in the buildscript when writing:

dependencies {
   compile project(':DependentProject') // exported = true, but how?
}

?

Thanks in advance!

like image 660
Prem Avatar asked Nov 08 '13 21:11

Prem


People also ask

How do I sync Gradle dependencies in IntelliJ?

We can configure the settings for how IntelliJ IDEA syncs with Gradle by pressing the settings icon in the Gradle tool window, and selecting Auto-Reload Settings. We can set IntelliJ IDEA to automatically reload the project after "Any changes" in the build script files, so changes are automatically reloaded.

How do I get Gradle dependency tree in IntelliJ?

To view Gradle dependencies as a diagram, click on the Show Dependencies icon on the Gradle tool window toolbar or use the shortcut Alt+Shift+Ctrl+U on Linux and Windows / Alt+Shift+Cmd+U on macOS.

How do I download dependencies in Gradle?

Downloading java dependencies is possible, if you actually really need to download them into a folder. Download the dependencies (and their dependencies) into the folder runtime when you execute gradle getDeps .


1 Answers

In Gradle, module B's dependencies will be automatically exported to A, although the details of how this works are different (e.g. there is conflict resolution).

like image 129
Peter Niederwieser Avatar answered Oct 07 '22 17:10

Peter Niederwieser