When adding a dependency to compile and the test dependency to testCompile (only distinguished by classifier), the testCompile dependency is missing:
repositories {
jcenter()
}
apply plugin: 'java'
dependencies {
compile(group: 'org.elasticsearch', name: 'elasticsearch', version: '2.0.0')
testCompile(group: 'junit', name: 'junit', version: '4.12')
testCompile(group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3')
testCompile(group: 'org.elasticsearch', name: 'elasticsearch', version: '2.0.0', classifier: 'tests')
testCompile(group: 'org.apache.lucene', name: 'lucene-test-framework', version: '5.2.1')
}
gradlew dependencies misses elasticsearch-tests.jar from testCompile.
IntelliJ shows the correct dependencies and they can be used by a test:
import org.elasticsearch.test.ESIntegTestCase;
import org.junit.Test;
public class DummyTest extends ESIntegTestCase {
@Test
public void shouldDoSomething() {
}
}
This was tested with gralde 1.12, 2.7 and 2.8.
Is there any way to get around that?