Home > Enterprise >  Losing Javadoc Comments When Importing a Maven Project as Module in a Gradle API Project
Losing Javadoc Comments When Importing a Maven Project as Module in a Gradle API Project

Time:10-15

I have a Gradle Spring Boot API Project and another Maven Project which I build as Artifact into a .jar file and import into my API Project as a Module. After doing that, everything works fine but the Javadoc comments that I made in the Maven Project for all the Services and Methods are not being preserved when I look at the methods in API Project. Is there a way to bring the Javadoc comments over to the API project?

CodePudding user response:

After some research, I figured out a way to do this. Posting it here, just in case someone else needs help regarding it. First of all, you need to add a Javadoc plugin (this will create a .jar file for the javadoc) to the project which is supposed to be packaged into a .jar file to be imported into another project.

In the project where you need to import the *.jar files: Go to File -> Project Structure -> Modules (in the side navigation bar) -> Dependencies -> Find the .jar that you have imported want to attach the Javadoc to -> Right-Click then "Edit"

A new window opens, click the " " button if your Javadoc is *.jar file and then find that *.jar add it there. If it is a link then add the link symbol and insert the link.

This should establish the connection between module *.jar file and its Javadoc *.jar file, which also enables the description (from Javadoc) of imported methods and classes in the quick preview while hovering over the method's instance.

Reference: https://stackoverflow.com/a/91514/15743238

  • Related