1: Download the source code and javadocs using Maven commands.
When using Maven in IDE, if you want to view the source code and javadoc of the classes in the referenced jar package, you need to download these source codes using Maven commands before introducing them, the MVN command can easily achieve this goal:
mvn dependency:sourcesmvn dependency:resolve -Dclassifier=javadoc
Command usage: first enter the corresponding Pom. xml directory, and then execute the preceding command:
The first command is to download the source code of the file that is dependent on POM. xml.
The second command is to download the corresponding javadocs
However, some files may not have source code or javadocs
Reference
2: Open the maven configuration file setting. XML (.../. m2/settings. XML) by adding the configuration file. Add the following Configuration:
<profiles><profile> <id>downloadSources</id> <properties> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </properties></profile></profiles><activeProfiles> <activeProfile>downloadSources</activeProfile></activeProfiles>
3: Configure eclipsewindow> preferences> Maven and checking the "Download artifact sources" and "Download artifact javadoc" Options