javamaven-dependency

How to make a maven dependency display descriptions of methods and classes


I created a private repository on Github and transferred my library project there via “commit and push”. But when I added this to the Maven dependencies of another project, when I hover or navigate (Ctrl + LMB), there are no descriptions (text in /** */) at all that I wrote and that are on Github

In Intellij, when going to any library class, a plate was displayed at the top, on which one of the options was “choose source”. I clicked, selected the Intellij library project and the descriptions appeared. But is there a way to get descriptions directly from the GitHub repository, so that in each new project you do not have to indicate this source?


Solution

  • You have to deploy additional artifacts alongside the .jar file to ensure that this hover-like functionality shows the documentations that you have written in the library. These additional artefacts are

    You can read more in detail about them here and you would also need the sources plugin depending on your setup

    Once you have the jar with sources and javadocs uploaded, you can then ask your IDE to download the sources and javadoc and then the documentation should be visible when you hover or navigate.