Why does gradle not find junit?

i had this problem a few years ago.

it did work like a charm back then. i just added gradle to a new java 8 project. and am having the same problem as before.

it says:

D:\ray\dev\goapps\go3>gradle test :compileJava D:\ray\dev\goapps\go3\src\equipment8\ToStringTestCase.java:3: error: package org .junit does not exist import static org.junit.Assert.*; ^ i am probably doing something really siily?

i deleted all the stuff in C:\Users\ray.gradle, but no joy.

thanks

build file:

task wrapper(type: Wrapper) { gradleVersion=‘2.3’ } repositories { mavenCentral() } apply plugin: ‘java’ targetCompatibility = “1.8” sourceCompatibility = “1.8” sourceSets.main.java.srcDirs = [“src”] sourceSets.test.java.srcDirs = [“tst”] sourceSets.main.resources.srcDirs = [“resources”] dependencies { compile fileTree(dir: ‘lib’, includes: [’*.jar’]) testCompile group: ‘junit’,name:‘junit’,version: ‘4.11’ } version = ‘0.1’ jar { manifest { attributes ‘Main-Class’: ‘gui.Main’ } } apply plugin: ‘application’ mainClassName = ‘gui.Main’ // for application plugin mainClassName = ‘controller.CommandLine’ // for application plugin //apply plugin: ‘checkstyle’ //apply plugin ‘project-report’

It appears to me that this failure happens during the ‘compileJava’ task, whereas the JUnit dependency is on the classpath for ‘:compileTestJava’. Your test code should be separate from your main code.

most of it is, but i did have one test case in src/ :frowning:

now it works like a charm again!

thanks