method One: through Eclipse
1. Set up maven first
2. Through the MAVEN under the jar package source code
Select Pom.xml--> Right-click-->run as-->maven build...--> in the total package directory
"Base Directory" input the project's working range address---"goals" input dependency:sources--
Tick "Update snapshots" and "Skip Tests"--RUN
Start downloading the source code for all the jars in the entire project until you see BUILD SUCCESS.
Please be patient while the packet is poor. If it succeeds:
See if it is successful, such as.
When the automatic compilation action of Eclipse is triggered, the source code and Javadoc are automatically downloaded.
After the download is complete, right-click-maven-update Project. In fact, the function of update project is to find the reporsitory in the coordinates directory there are no source and Javadoc files, if any, add to eclipse's build path. Note that this operation, and before there is not checked "Download Artifact Sources" and "Download Artifact JavaDoc" are not related, but completely look at the coordinates of the directory there is no corresponding file.
In addition, the automatic compilation of Eclipse, not 100% will trigger the download source code and Javadoc this action. It is possible that the combination of the two is not very good.
Reference: resolve Eclipse left key cannot view the source code of MAVEN third party package
method Two: through Maven Command
MVN dependency:sources
MVN Dependency:resolve-dclassifier=javadoc
How to use the command: first go to the appropriate Pom.xml directory, and then execute the above command:
The first command is to try to download the source code of the files that are dependent on pom.xml.
The second command: is to try to download the corresponding Javadocs
However, it is possible that some files do not have source code or Javadocs
After execution, update project in Eclipse to associate to eclipse.
Eclipse+maven View source code and Javadoc