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

in java •  8 years ago 

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’
    )
}
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!