I'm doing some testing work that requires the use of features in JUnit which are unfamiliar to me. In order to better understand these features I'd like to be able to view the JUnit sources inside IntelliJ alongside my project.
This project uses Maven. I have the following dependency for jUnit listed in my pom.xml file:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
When I run "mvn clean install" on the command line the jUnit sources are downloaded from my company's Maven repository into my local Maven repository (.m2 directory). The project then compiles and runs without issue.
After right-clicking on the pom.xml file and selecting Maven->Reimport I can see that the classes, sources, and javadocs for jUnit are also present in the library settings in IntelliJ:
However, when I try to open a jUnit class file in IntelliJ and click on the "Download Sources" link I see this:
It seems to might like IntelliJ should be finding these sources just fine locally. Even if it did have to download them from my company's repository I also believe it should find them there since that's where the junit-4.10-sources.jar file in my local repository originally came from.
What might be keeping IntelliJ from loading the sources from the JAR file that it already knows about?