External documentation for Gradle project dependencies
已回答
I'm working in a Gradle project and the "External Documentation" option isn't available. Quick documentation works (it uses with the sources jar rather than the docs jar). Note I'm talking about all dependencies (Spring etc) not just the JDK.
In Maven projects Intellij has an option to automatically load documentation (and sources). Is there a way to make this work with Gradle projects?
请先登录再写评论。
Please see https://dzone.com/articles/gradle-goodness-download-javadoc-files-for-depende.
Adding IDEA-specific stuff is ugly. I opened a ticket for this: https://youtrack.jetbrains.com/issue/IDEA-286107
For Gradle projects sources of the project library dependencies should be downloaded by default during the project import. If one needs a custom behaviour (for sources/javadoc), it can be configured in Gradle build file as per Gradle's documentation: https://docs.gradle.org/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html. This behaviour is by Gradle and IntelliJ IDEA's design.
If downloading by default does not work, there could be some reason/issue for this. Please check that sources and docs exist for the dependencies and the Gradle command line build for the project pulls them into local Maven repository or Gradle cache.
If issue remains, please clarify if sources/docs are available in local repository/cache. Attach idea.log file (use Help | Show Log in ... action to reveal it) after IDE restart and reproducing (Reload action in gradle tool window for the project). Thank you.
Thank you Zeljko Trogrlic for this question, it helped me arrive at what you asked.
I share with world the solution for this
context:
$gradlew --version
Gradle 8.14.2
With some help of chatgpt and after finding this thread on google:
me(chatgpt):why is my intellij not fetching documentation automatically?
chatgpt: bad answer…
google: intellij gradle Download external documentation
I find this thread. still not satisfactory…
me(chatgpt):
I found online that I need to change build.gradle.kts:
How to add this without changing build.gradle.kts which and having private (non-git) settings?
chatgpt(after some errors):