Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

How to include local jar file in gradle

$
0
0

No matter which repository type you use, you still need to declare the actual dependency. The repository is just a location to look for dependencies. It doesn’t automatically make your project depend on every single artifact in the repository.

For example, if you use the flat dir repository, you’ll have:

repositories {
    flatDir {
        dirs '/…/gradle-changedistiller/libs'
    }
}

If you have a file named changedistiller-0.0.1-SNAPSHOT-jar-with-dependencies.jar in the flat dir, you could add that dependency as:

dependencies {
    implementation name: 'changedistiller', version: '0.0.1-SNAPSHOT', classifier: 'jar-with-dependencies'
}

You can also rename the file, if you’re not happy with the exact name, version, classifier values.


Viewing all articles
Browse latest Browse all 19888

Trending Articles