Git Product home page Git Product logo

gradle-download-dependencies-plugin's Introduction

Gradle - DownloadDependencies

The purpose of this plugin is to allow the use of the Gradle dependency resolution but with the dependencies saved as part of the project.

To achieve this it adds the task downloadDependencies that downloads all dependencies - libraries, sources, javadocs and maven poms (including parents) - into a local repository that follows the maven structure for the root project and all subprojects.

If the task graph doesn’t include the task downloadDependencies, the plugin will replace the specified repositories with the local repository.

The intended workflow is

  • to execute downloadDependencies whenever the dependencies have changed,

  • to add the changes to the local repository to the version control system

  • and after that transparently use the local repository for dependency resolution.

Usage

Usually all it takes to use the plugin is to add it to the buildscript dependencies and apply it.

build.gradle
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'net.idlestate:gradle-download-dependencies-plugin:1.+'
    }
}

apply plugin: 'net.idlestate.download-dependencies'
apply plugin: 'java'

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
}

dependencies {
    // dependencies of your project
}

// ...

Tasks

downloadDependencies

The task downloadDependencies downloads the dependencies into a local repository that follows the maven structure.

cleanupLocalRepository

The task cleanupLocalRepository removes unused dependencies from the local repository.

Extension properties

The plugin can be configured by the extension downloadDependencies. It takes a file into localRepository to change the path of the local maven repository from the default "${rootProject.projectDir}/gradle/repository".

build.gradle
// ...

downloadDependencies {
    localRepository = file( 'alternative/path/to/repository' )
}

// ...

License

gradle-download-dependencies-plugin's People

Contributors

gfelbing avatar ssp avatar tehlers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-download-dependencies-plugin's Issues

Optional POM Dependencies aren't Downloaded

In order to reproduce this, you'd need to attempt to download a dependency that lists optional dependencies in its POM file. The behavior I see is that everything gets downloaded except the optional dependencies. I'd expect that the optional dependencies would be able to be downloaded.

This also makes me wonder if a transitive, provided dependency would also be ignored (a dependency in the POM with the 'provided' scope). I'd expect that this plugin should be able to download all of the dependencies.

My use case for this plugin is for transferring my team's external dependencies from jcenter to my company's Artifactory server. The optional dependencies being ignored causes problems for this use case because the optional dependencies don't get transferred to our Artifactory server. This in turn causes Gradle to throw errors, because Gradle will attempt to lookup optional dependencies even if they're not in use.

Some more configuration options would be nice

I find this gradle plugin really useful. One feature that would be nice to have is the ability to configure the plugin with the types of artifacts that should be downloaded. For example, I don't always need to download the javadoc artifacts. It would be nice if I could turn that off.

Thanks!

Broken with Gradle 5.0

This plugin was working just fine for Gradle 4.10.2, but I'm now getting some errors after upgrading to Gradle 5.0.

Here is the error I'm seeing:

Execution failed for task ':downloadDependencies'.
> Receiver class net.idlestate.gradle.downloaddependencies.DownloadDependenciesTask$ParentComponentIdentifier does not define or inherit an implementation of the resolved method abstract getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier; of interface org.gradle.api.artifacts.component.ModuleComponentIdentifier.

It looks like Gradle may have some interface changes that caused this, but I haven't looked into it. Since Java 11 has released (which is kind of huge), it'd probably be a good idea to update your library so that it integrates with the latest tools.

Can'd download apt dependency

I'm using is android and use kotlin apt apply plugin: 'kotlin-kapt', when use Glide,

dependencies {
    kapt 'com.github.bumptech.glide:compiler:4.8.0'
}

it will show:

Library file compiler-4.8.0.jar of dependency com.github.bumptech.glide:compiler:4.8.0 not found even when considering potential classifiers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.