Home > Java > javaTutorial > body text

How Can I Download Source JARs and Javadocs From Maven Repositories?

Patricia Arquette
Release: 2024-11-05 22:11:02
Original
385 people have browsed it

How Can I Download Source JARs and Javadocs From Maven Repositories?

Maven Source JAR Retrieval

It's possible to retrieve source JARs from Maven repositories using the following steps:

Step 1: Download Source Code

Execute the following command to download source code for all project dependencies:

mvn dependency:sources
Copy after login

Step 2: Download Javadocs

To download Javadocs, use the following command:

mvn dependency:resolve -Dclassifier=javadoc
Copy after login

Notes:

  • Maven's ability to retrieve source JARs and Javadocs depends on the availability of these artifacts in the repositories.
  • You can specify specific dependencies to retrieve using the -DincludeArtifactIds option. For example, to retrieve sources only for the guava dependency:
mvn dependency:sources -DincludeArtifactIds=guava
Copy after login

References:

  • [Maven Micro-Tip: Get sources and Javadocs](http://tedwise.com/2010/01/27/maven-micro-tip-get-sources-and-javadocs/)
  • [Maven Dependency Plugin - Sources Mojo](https://maven.apache.org/plugins/maven-dependency-plugin/sources-mojo.html)

The above is the detailed content of How Can I Download Source JARs and Javadocs From Maven Repositories?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!