I am making a local Java utility library and building it into a JAR file. I am also building a JAR file for the Javadocs.
These are the JAR files generated by Maven:
Now, I am trying to use the Javadocs JAR file with IntelliJ IDEA by importing it in File > Project Structure, and it works. I get hints and documentation for code references in my IDE. But as soon as I reload my Maven project, the Javadocs are gone and I have to manually add it back.
I am also getting this warning from IntelliJ everytime I add the Javadoc JAR file back.
What is the proper way of adding a Javadoc JAR file into a Maven project?



There is a more general maven-style way and should be preferred over the "IDE way". You can use a local "fake" repository inside your project. Add the jar files to your repo. The maven call depends on the type of the jar.
The jar:
The sources:
The javadoc:
The next step is adding the repo and the dependency to your pom: