I am trying to get Gradle (2.1) and IntelliJ (14.0.2) to play well. In particular, I imported a sample Gradle project containing a separate set of sources for integration tests in IntelliJ.
The project builds fine using Gradle on the command line, and I can successfully complete the integration tests. On the other hand, while working inside IntelliJ, I have two problems:
1) Compilation inside IntelliJ is not performed due to a dependency in the integration test with a third-party library (collections of collections), which is not allowed.
2) If I remove the dependency above and compile, I cannot run the integration test inside IntelliJ. The following error message appears:
The tests found do not include: [org.gradle.PersonIntegrationTest.canConstructAPersonWithAName]
The file structure is as follows:
src integration-test java resources main java resources test java resources build.gradle
And build.gradle:
apply plugin: 'java' repositories { mavenCentral() } sourceSets { integrationTest { java.srcDir file('src/integration-test/java') resources.srcDir file('src/integration-test/resources') } } dependencies { testCompile 'junit:junit:4.11' integrationTestCompile 'commons-collections:commons-collections:3.2' integrationTestCompile sourceSets.main.output integrationTestCompile configurations.testCompile integrationTestCompile sourceSets.test.output integrationTestRuntime configurations.testRuntime } task integrationTest(type: Test, dependsOn: jar) { testClassesDir = sourceSets.integrationTest.output.classesDir classpath = sourceSets.integrationTest.runtimeClasspath systemProperties['jar.path'] = jar.archivePath } check.dependsOn integrationTest
Any ideas on how to make this work would be greatly appreciated.
A complete sample of the Gradle project is available in the Gradle distribution, under the / java / withIntegrationTests samples
intellij-idea intellij-14 gradle
Daniel
source share