How to run JUnit tests with Gradle?
问题 Currently I have the following build.gradle file: apply plugin: 'java' sourceSets { main { java { srcDir 'src/model' } } } dependencies { compile files('libs/mnist-tools.jar', 'libs/gson-2.2.4.jar') runtime fileTree(dir: 'libs', include: '*.jar') } This build.gradle file is for my repository here. All of my main files are in src/model/ and their respective tests are in test/model . How do I add a JUnit 4 dependency correctly and then run those tests in the folders of tests/model ? 回答1: How do