Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle: Make a 3rd party jar available to local gradle repository

currently, I'm testing Gradle as an alternative to Maven. In my projects, there are some 3rd party jars, which aren't available in any (Maven) repositories. My problem is now, how could I manage it to install these jars into my local .gradle repository. (If it's possible, I don't want to use the local Maven repository, because Gradle should run independently.) At the moment, I get a lot of exceptions because of missing jars. In Maven, it's quite simple by running the install command. However, my Google search for something similar to the Maven install command wasn't successful. Has anybody an idea?

like image 456
MH. Avatar asked Apr 03 '10 21:04

MH.


People also ask

What is Mavencentral () in Gradle?

Maven Central is a popular repository hosting open source libraries for consumption by Java projects. To declare the Maven Central repository for your build add this to your script: Example 1. Adding central Maven repository. build.gradle.


1 Answers

you can include your file system JAR dependencies as:

dependencies {     runtime files('libs/a.jar', 'libs/b.jar')     runtime fileTree(dir: 'libs', include: '*.jar') } 

you may change runtime for compile/testCompile/etc..

like image 104
tolitius Avatar answered Sep 20 '22 01:09

tolitius