Attach sources does not seem to work

What is the deal with attach sources?   Is there some magic sequence of steps to get it to "take" ?

An example here: i added jackson-json.<version>.jar to the project (systemPath in maven), that works fine.  Then when clicking on code that uses it, "Source not found". Which is also fine. Then I click on "Attach sources" and select jackson-jsonpath-2.1.0-SNAPSHOT-sources.jar.   Well, no error message. And also no effect: the sources are still never found.

That was an example. I have seen this pattern repeatedly. I'd be happy to learn there were some additional step required (but not obvious or documented) to fix this issue.

thanks

5 comments
Comment actions Permalink

I see a stackoverflow question on this - apparently this really does not work..  Is there a fix in progress (or delivered but i fail to see it..) for this?


http://stackoverflow.com/questions/13520532/attaching-sources-in-intellij-idea-for-scala-project


From that SOF post: Aha.. fixed.
   So: I used to use 'attach source' in the top of the window editor - it does not work (I guess it is a bug - maybe related to the scala plugin, because usually it works).
  But if try to attache sources to particular library - in "Project Structure -> Library -> +Attach File or Directories -> Sources" then it works.
  Thanks.

0
Comment actions Permalink

(deleted comment)

.

0
Comment actions Permalink

Yes, downloading and attaching sources via the IDE is buggy. What I found useful was to enable maven to do this default (downloading sources / javadoc) when downloading the dependency by modifying my maven settings.xml.

But if you don't want that but do it for a particular project, then do the below:

mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
 
0
Comment actions Permalink

This functions is still broken:

I click:

Select file:

 

 

and nothing happens, renavigating to method text doesn't help

0

Please sign in to leave a comment.