GRADLE: HOW TO ADD A LIST OF LOCAL .JAR FILES TO THE BUILD CLASSPATH

Sometimes you don’t want/cant use maven repos, all you have is a bunch of local jars on disk that you want to use as part of your compilation classpath, and the freaking gradle documentation is too vague.

Here is an example:

dependencies {
  compile files(lib/jars/gettext-commons.jar,
    lib/jars/lucene-3.5.0.jar,
    lib/jaudiotagger.jar,
    lib/jars/h2-1.3.164.jar,
    lib/jars/messages.jar,
    lib/jars/slf4j-api-1.7.5.jar,
    lib/jars/jaudiotagger.jar,
    lib/jars/metadata-extractor-2.6.2.jar
    )
}
H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center