74

I have the following descriptions for some Maven entries in Project Structure:

enter image description here

Javadoc file is really absent in filesystem. Simultaneously, it is present in central repository. Why it was not downloaded and how to download it by force?

UPDATE

These options are ON already:

enter image description here

Have tried to recompile, close/open etc after setting them...

Dims
  • 47,675
  • 117
  • 331
  • 600
  • 1
    Erm ... is it necessary to download the javadocs? With Eclipse, the IDE itself is capable of extracting and formatting the javadoc comments embedded in the source code. – Stephen C Jun 26 '15 at 12:03
  • 1
    It is complex problem, I am investigating. Yes, Idea is also able to show javadocs, generated on the fly from code. – Dims Jun 26 '15 at 12:05
  • 4
    File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing, check the boxes for downloading sources and/or documentation. See https://www.jetbrains.com/idea/help/editing-maven-settings.html, https://www.jetbrains.com/idea/help/maven-2.html and https://www.jetbrains.com/idea/help/maven-importing.html – M. Deinum Jun 26 '15 at 12:20
  • @M.Deinum, sorry forgot to mention, that I have turned these boxes on already – Dims Jun 26 '15 at 13:52
  • A related Question: [*Download doc for only one Maven dependency in IntelliJ*](https://stackoverflow.com/q/45474904/642706) – Basil Bourque Jun 22 '18 at 05:57

4 Answers4

126

Click on the "maven projects" (make sure tool buttons are on) on the right side of IntelliJ and then click on "Download Documentation".

Also, for future downloading, you can go to File -> Settings -> Build,execution, deployment, -> build tools -> Maven -> importing -> mark "Documentation" checkbox and apply settings.

Pang
  • 9,564
  • 146
  • 81
  • 122
user3207081
  • 1,451
  • 2
  • 11
  • 10
  • Sorry, what is "right side of intelij"? I have small toolbar at the top right with few buttons there, including "make project", "run", "debug", etc, but no any says anything about documentation... – Dims Jun 26 '15 at 13:55
  • It might happen that mvn repositories (Build, Execution, Deployment > Build Tools > Maven > Repositories) were not updated. Reasons can vary. In my case the password for those repos was expired (in my case a project-specific settings.xml) After fixing that I clicked "Update" in IDEA's list of repositories and they got downloaded. Note: to check whether javadoc was downloaded, you can check existence of *-javadoc.jar artefacts in your mvn repository (usally under ~/.m2/repository) – gicig Aug 22 '23 at 13:54
75

Maven Projects panel

Maven Projects tool window > Icon with green arrow and a box > Download Documentation:

enter image description here

See IntelliJ IDEA documentation for Version 14.1 or current version.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
Ilya Serbis
  • 21,149
  • 6
  • 87
  • 74
  • 5
    Does this ever work, I have tried it multiple times, it just executes and when it finishes, I still can't see the java docs when I open a dependency source file, even jdk classes such as LocalTime and the rest just source code, no javadocs – Samuel Owino Jan 10 '20 at 23:50
  • IntelliJ 2019.3.1 – Samuel Owino Jan 10 '20 at 23:50
  • the downside of this is the IntelliJ (not intelligently) will start to download the doc of every dependency in the project, not just those that are of your interest (Netbeans is priceless in these things) – FiruzzZ Jul 16 '21 at 01:02
0

For me, it worked when I pressed on Download Source and Documentation.

0

By the way, if you experience same case with me (working with corporate Maven repository), Maven may be ignoring an opportunity to further download javadoc if it once wasn't there. And to make it request it one more time, you have to remove <artifactId>-<version>-javadoc.jar.lastUpdated file from .m2/repository/<groupId>/<artifactId>/<version>, then try again.

vintprox
  • 931
  • 1
  • 11
  • 24