0

My Gradle project has a couple of maven dependencies. I don't want those included in my jar. It also has some dependencies on local jars. How can i include the classes from those in the output jar?

Kilobyte
  • 320
  • 3
  • 16
  • Hmm.. If You don't include the dependencies, the resulting artifact can not be run. Have a look at here: http://stackoverflow.com/questions/4871656/using-gradle-to-build-a-jar-with-dependencies – Opal Apr 14 '14 at 15:46

1 Answers1

0

You can refer to a local repository (a directory in this case) with the following:

repositories {
    ivy {
        // URL can refer to a local directory
        url "../local-repo"
    }
}

To exclude the dependent jars from your final jar, you can use the compile configuration like this:

compileOnly files('libs/jgrapht-jdk1.6.jar')
compile 'org.simpleframework:simple-xml:2.7'

A more detailed answer can be seen over here: Gradle dependencies local jar file

Community
  • 1
  • 1
Csuki
  • 1,297
  • 8
  • 21