Basic gradle project in eclipse - missing the dependent jars in the build path - whats missing?


(will.woodman) #1

starting - new - been struggling with maven and was killing me - so i tried gradle.

i have installed gradle 1.5, i have STS eclipse build and installed the gradle eclipse plugin

i created a new gradle project in new workspace - however this errors as it cant find the junit 4.11 jar.

I have checked in the repository and its downloaded it. and it seems happy with the commons-logging. but the gradle generated project cant see the junit jar

in eclipse its added GroovyDSL support, Groovy librraies, JRE system libraries, grdale dlsd support. non on these contains the doanloaded junit jar

how do i get it to see that jar in the build path ?? So nearly there and i so want this to work. how do i add the dependant jar build into the class build ?

build.grdale looks like this - i chnaged the junit 4.+ to 4.11 but thats it

apply plugin: ‘java’ apply plugin: ‘eclipse’

sourceCompatibility = 1.7 version = ‘1.0’ jar {

manifest {

attributes ‘Implementation-Title’: ‘Gradle Quickstart’, ‘Implementation-Version’: version

} }

repositories {

mavenCentral() }

dependencies {

compile group: ‘commons-collections’, name: ‘commons-collections’, version: ‘3.2’

testCompile group: ‘junit’, name: ‘junit’, version: ‘4.11’ }

test {

systemProperties ‘property’: ‘value’ }

uploadArchives {

repositories {

flatDir {

dirs ‘repos’

}

} }


(will.woodman) #2

PS if i look on the java build path in eclipse - it lists a gradle depencies library - but its empty no jars there.

also if i look on the prtoject tree - the gradle dependencies library doesnt show


(will.woodman) #3

whoa - weird - just went to prject root and theres a gradle option on the right click - selected the refresh dependencies and its downloaded from maven again and this time the dependiceies librray in in the project tree and it compiles

very weird -

but i seem to have basic project working

now to figure out how i drive it !


(Peter Walker) #4

I have just run your script with 1.5 and I couldn’t reproduce this issue. What do you see in the “Gradle Dependencies” classpath container?