15

I want to view Spring Documentation via Intellj's View->Quick Documentation features. To achieve this, I have tried this following by using external documentation link:

Ok, I've added the url of the Spring Framework docs. as instructed, but yet, when I do ctrl+Q on a Spring Framework item, it doesn't show any docs. on the pop-up above...

Here is the url I used: https://docs.spring.io/spring-framework/docs/current/javadoc-api/

Intellij Support

But it is not working.

Can anyone help, please?

Community
  • 1
  • 1
mnhmilu
  • 2,327
  • 1
  • 30
  • 50

1 Answers1

20

Quick Documentation

"Quick Documentation" is different from "External Documentation". For "Quick Documentation" you just need to configure your dependencies to include sources.

Do you have a Maven or Gradle project?

For Gradle and IntelliJ you can use the gradle-intellij-plugin in your build.gradle(.kts) file. It has a downloadSources option, which is true by default.

For Maven, there is an option to automatically download sources, documenation, and annotations in the IntelliJ settings under "Maven" > "Importing".

To see whether it's working or to do it manually, go to "Project Structure" > "Project Settings" > "Libraries" in IntelliJ. You can see and manually add or modify the source JARs and documentation URLs for all your libraries.

External Documentation

For external documentation (opening JavaDoc in the browser), you can tell IntelliJ to download the JavaDoc with the idea Gradle plugin like this:

idea {
    module {
        downloadJavadoc = true 
        //or in Gradle Kotlin DSL:
        //isDownloadJavaDoc = true
    }
}

For Maven the option is again in the IntelliJ settings.

Dario Seidl
  • 4,140
  • 1
  • 39
  • 55
  • OK, there is a setting for maven in IntelliJ. I updated the answer for you. – Dario Seidl Apr 07 '20 at 09:57
  • 6
    Thanks, I had to initiate download by Right Click the project ->Maven->Download Documentation. Now it is working perfectly. – mnhmilu Apr 07 '20 at 10:32
  • 1
    Is there also a way to enable external documentation on the spring related classes (i.e. select a spring class type, use the 'external documentation' command to view its api in browser)? I configure the documentation path in project setting as https://docs.spring.io/spring-framework/docs/current/javadoc-api/ but its not working – torez233 Aug 16 '20 at 18:36
  • @hafan96 You can try it as described here: https://dzone.com/articles/gradle-goodness-download-javadoc-files-for-depende I'll update my answer too. – Dario Seidl Aug 19 '20 at 08:44
  • 3
    For those coming from https://stackoverflow.com/a/20746942/1243462 THIS is the correct way to get the Eclipse-style behaviour in IDEA. If this ALONE doesn't work, you need to right click project root -> "Maven" -> "Download sources and Documentation" . Finally, "File" -> "Invalidate Caches" and restart. – shikharraje Nov 01 '21 at 13:01
  • @shikharraje you are repeating what mnhmilu said. – brohjoe Nov 27 '22 at 17:52