Sources still not found after downloading/attaching them
Answered
I'm trying to use the sources jar file for a maven library, but while I have the sources jar downloaded and it's attached to the library in the Project (see attached screenshot), IntelliJ still goes to decompile the class file, even when I click the Download Sources or Choose Sources, it still doesn't switch to using the .java file. I'm using the following in my pom.xml file to load it in, and I have IntelliJ set to auto-update maven projects. I also tried File->Invalidate Caches & Restart, and that didn't work.
<dependency>
<groupId>com.google.openrtb</groupId>
<artifactId>openrtb-core</artifactId>
<version>1.5.1</version>
</dependency>

Please sign in to leave a comment.
Please try to browse inside the sources jar to verify that it has .java files packaged in the correct location.
They do appear to be. Here's the listing. The listing for the openrtb-core-1.5.1.jar file is far, far longer (OpenRtb class has lots of inner classes), but it is at the same path (com/google/openrtb/OpenRtb.class) inside it's jar file.
And here's my maven dir:
pwd
/Users/aaron/.m2/repository/com/google/openrtb/openrtb-core/1.5.1
ls -l
total 6592
-rw-r--r-- 1 aaron staff 237 Mar 30 12:05 _remote.repositories
-rw-r--r-- 1 aaron staff 1927794 Mar 30 12:13 openrtb-core-1.5.1-javadoc.jar
-rw-r--r-- 1 aaron staff 452974 Mar 30 12:05 openrtb-core-1.5.1-sources.jar
-rw-r--r-- 1 aaron staff 40 Mar 30 12:05 openrtb-core-1.5.1-sources.jar.sha1
-rw-r--r-- 1 aaron staff 963467 Mar 30 11:51 openrtb-core-1.5.1.jar
-rw-r--r-- 1 aaron staff 40 Mar 30 11:51 openrtb-core-1.5.1.jar.sha1
-rw-r--r-- 1 aaron staff 6613 Mar 30 11:50 openrtb-core-1.5.1.pom
-rw-r--r-- 1 aaron staff 40 Mar 30 11:50 openrtb-core-1.5.1.pom.sha1
jar tf openrtb-core-1.5.1-sources.jar
META-INF/MANIFEST.MF
META-INF/
com/
com/google/
com/google/openrtb/
com/google/openrtb/util/
com/google/openrtb/snippet/
com/google/openrtb/json/
META-INF/maven/
META-INF/maven/com.google.openrtb/
META-INF/maven/com.google.openrtb/openrtb-core/
com/google/openrtb/Gender.java
com/google/openrtb/snippet/package-info.java
com/google/openrtb/json/OpenRtbNativeJsonWriter.java
com/google/openrtb/json/OpenRtbNativeJsonReader.java
com/google/openrtb/json/OpenRtbJsonWriter.java
com/google/openrtb/json/package-info.java
com/google/openrtb/package-info.java
com/google/openrtb/OpenRtb.java
com/google/openrtb/util/ResponseBidsIterator.java
com/google/openrtb/util/OpenRtbValidator.java
com/google/openrtb/json/OpenRtbJsonExtWriter.java
com/google/openrtb/json/OpenRtbJsonFactory.java
com/google/openrtb/json/AbstractOpenRtbJsonReader.java
com/google/openrtb/json/OpenRtbJsonExtComplexReader.java
com/google/openrtb/json/OpenRtbJsonExtReader.java
com/google/openrtb/json/OpenRtbJsonUtils.java
com/google/openrtb/json/AbstractOpenRtbJsonWriter.java
com/google/openrtb/json/OpenRtbJsonReader.java
META-INF/maven/com.google.openrtb/openrtb-core/pom.xml
com/google/openrtb/util/ProtoUtils.java
openrtb.proto
com/google/openrtb/util/OpenRtbUtils.java
META-INF/maven/com.google.openrtb/openrtb-core/pom.properties
com/google/openrtb/snippet/OpenRtbSnippetProcessor.java
com/google/openrtb/util/package-info.java
com/google/openrtb/snippet/OpenRtbMacros.java
com/google/openrtb/snippet/SnippetProcessor.java
com/google/openrtb/snippet/SnippetMacroType.java
com/google/openrtb/snippet/SnippetProcessorContext.java
com/google/openrtb/snippet/UndefinedMacroException.java
Please file a bug at https://youtrack.jetbrains.com/issues/IDEA with the sample project to reproduce attached.
Also attach idea.log to the issue (https://intellij-support.jetbrains.com/hc/articles/207241085).
Closed, deleted all the log files to get a nice fresh one, after starting up and trying to open the OpenRtb class, I see this in the log file, along with a threadDumps-freeze directory.
ERROR - .psi.impl.compiled.ClsFileImpl - jar:///Users/aaron/.m2/repository/com/google/openrtb/openrtb-core/1.5.1/openrtb-core-1.5.1.jar!/com/google/openrtb/OpenRtb.class
com.intellij.diagnostic.PluginException: Unexpected mirror file: PsiFile(plain text):OpenRtb.java [Plugin: org.jetbrains.java.decompiler]
Time for a bug ticket!
https://youtrack.jetbrains.com/issue/IDEA-189287
Adding the following in Help | Edit Custom Properties will fix the problem:
Thanks for the quick help!