Reputation: 1631
I have problem with include local jar file.
I have two projects:
ProjectA
ProjectB
--libs
----jgrapht-jdk1.6.jar
My build file include (This is the part that concerns projectB):
project(':ProjectB') {
apply plugin: 'java'
repositories {
mavenCentral()
}
configurations {
compileOnly
}
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
dependencies {
compileOnly files('libs/jgrapht-jdk1.6.jar')
compile 'org.simpleframework:simple-xml:2.7@jar'
}}
I run command gradlew -q dependencies and see result
archives - Configuration for archive artifacts.
No dependencies
compile - Compile classpath for source set 'main'.
\--- org.simpleframework:simple-xml:2.7
compileOnly
No dependencies
default - Configuration for default artifacts.
\--- org.simpleframework:simple-xml:2.7
runtime - Runtime classpath for source set 'main'.
\--- org.simpleframework:simple-xml:2.7
testCompile - Compile classpath for source set 'test'.
\--- org.simpleframework:simple-xml:2.7
testRuntime - Runtime classpath for source set 'test'.
\--- org.simpleframework:simple-xml:2.7
Line compile 'org.simpleframework:simple-xml:2.7@jar' - working fine,
but line compileOnly files('libs/jgrapht-jdk1.6.jar') don't work.
I use gradle 1.8, Windows 7 x64 Tell me please where I made a mistake.
Upvotes: 2
Views: 10717
Reputation: 123958
It's a known limitation that file dependencies aren't currently shown by gradle dependencies
. They nevertheless work (if the paths are right).
Upvotes: 3