in Code

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’
)
}

Write a Comment

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.