apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'groovy'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
//Artifactory Central Repository
buildscript {
repositories {
maven {
url 'abc'
credentials {
username = ""
password = ""
}
Gradle uses its own dependency cache:
Gradle contains a highly sophisticated dependency caching mechanism, which seeks to minimise the number of remote requests made in dependency resolution, while striving to guarantee that the results of dependency resolution are correct and reproducible.
The Gradle dependency cache consists of two storage types located under
GRADLE_USER_HOME/caches:
- A file-based store of downloaded artifacts, including binaries like jars as well as raw downloaded meta-data like POM files and Ivy files. The storage path for a downloaded artifact includes the SHA1 checksum, meaning that 2 artifacts with the same name but different content can easily be cached.
- A binary store of resolved module metadata, including the results of resolving dynamic versions, module descriptors, and artifacts.
[...]
Where, as documented here, GRADLE_USER_HOME is:
The Gradle user home directory (
$USER_HOME/.gradleby default) is used to store global configuration properties and initialization scripts as well as caches and log files. [...]
You can configure Gradle to search your local Maven repository:
[...]
To declare the local Maven cache as a repository add this to your build script:
Example 8. Adding the local Maven cache as a repository
repositories { mavenLocal() }Gradle uses the same logic as Maven to identify the location of your local Maven cache. If a local repository location is defined in a
settings.xml, this location will be used. Thesettings.xmlinUSER_HOME/.m2takes precedence over thesettings.xmlinM2_HOME/conf. If nosettings.xmlis available, Gradle uses the default locationUSER_HOME/.m2/repository.
Note, however, that Gradle cautions against using the local Maven repository unless you really need it.
With the maven-publish plugin you can publish to your local Maven repository, if needed:
For integration with a local Maven installation, it is sometimes useful to publish the module into the Maven local repository (typically at $USER_HOME/.m2/repository), along with its POM file and other metadata. In Maven parlance, this is referred to as 'installing' the module.
The Maven Publish Plugin makes this easy to do by automatically creating a
PublishToMavenLocaltask for eachMavenPublicationin thepublishing.publicationscontainer. The task name follows the pattern ofpublishubNamePublicationToMavenLocal. Each of these tasks is wired into thepublishToMavenLocalaggregate task. You do not need to havemavenLocal()in yourpublishing.repositoriessection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With