# HG changeset patch # User Oleksandr Gavenko <gavenkoa@gmail.com> # Date 1534113208 -10800 # Node ID abede030dc1db2820ee2ff98e1057ae8b75cd3fa # Parent 0243bb26fe024d8d70816ceebe697925684216ed Configuring external dependencies. diff -r 0243bb26fe02 -r abede030dc1d gradle.rst --- a/gradle.rst Wed Aug 08 23:14:45 2018 +0300 +++ b/gradle.rst Mon Aug 13 01:33:28 2018 +0300 @@ -216,6 +216,54 @@ For each configuration ``build<ConfigurationName>`` and ``upload<ConfigurationName>`` are defined. +Configuring external dependencies +================================= + +Adding large well known artifact repositories:: + + repositories { + mavenCentral() + jcenter() + } + +``mavelLocal()`` for local ``~/.m2`` or whenever Maven ``settings.xml`` is pointing. + +Adding custom repositories:: + + repositories { + maven { url "http://repo.example.com/maven2" } + ivy { url "http://repo.example.com/ivy" } + maven { + url "http://repo.example.com/maven2" + username "ro-user" + password "pas$$word" + } + } + +Excluding transitive dependencies:: + + compile 'org.springframework:spring-web:4.3.10.RELEASE' { + exclude group: 'com.google.code.gson', module: 'gson' + } + + configurations.all { + exclude group: 'com.google.code.gson', module: 'gson' + } + + configurations.runtime { + exclude group: 'com.google.code.gson', module: 'gson' + } + +Forcing a specific version of a transitive dependency:: + + configurations.all { + resolutionStrategy.force 'com.google.code.gson:gson:2.8.1' + } + +Declaring dependency on module in multi-module build:: + + compile project(':core') + List project properties ======================= ::