With the latest version of Intellij and a clean run of the idea plugin, my
test code in the IDE acts as if it can't find JUnit on the classpath(good
code is red). The jar appears as usual in the external libraries list, and
Intellij can even compile the files, but won't allow me to run them.
Not sure if this is a problem with IntelliJ or Gradle so I thought I'd check
and see if anyone else was having similar problems.

Given a new project with this build.gradle:
apply plugin : 'java'
apply plugin : 'idea'

repositories{
        mavenCentral()
}
dependencies {
        testCompile 'junit:junit:4.8.2'
}

And a single test file in src/test/java:
import org.junit.Test;
public class IdeaModuleDependencyTest
{
        @Test
        public void someTest()  {       }
}

The generated .iml file references the junit jar, and it appears to be
correct:
    <orderEntry type="module-library" scope="TEST">
      <library>
        <CLASSES>
          <root
url="jar://$USER_HOME$/.gradle/cache/junit/junit/jars/junit-4.8.2.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES>
          <root
url="jar://$USER_HOME$/.gradle/cache/junit/junit/sources/junit-4.8.2-sources.jar!/"
/>
        </SOURCES>
      </library>
    </orderEntry>

Gradle can run this without problems, but Intellij insists that it cannot
find the JUnit dependency. Note that everything appears to be working fine
with the main classpath, this just affects test. So has anyone else seen
this? And if so, is it a problem with the idea plugin or should I log a bug
with Intellij?

Thanks in advance for any help! 


--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Weird-problem-with-Intellij-10-5-and-idea-plugin-tp4435598p4435598.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to