gpt4 book ai didi

java - 从 Maven 存储库获取源 JAR

转载 作者:bug小助手 更新时间:2023-10-28 01:35:41 25 4
gpt4 key购买 nike

是否有人知道您是否可以在 Maven 存储库中找到源 JAR?

最佳答案

Maven Micro-Tip: Get sources and Javadocs

When you're using Maven in an IDE you often find the need for your IDE to resolve source code and Javadocs for your library dependencies. There's an easy way to accomplish that goal.

mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc

The first command will attempt to download source code for each of the dependencies in your pom file.

The second command will attempt to download the Javadocs.

Maven is at the mercy of the library packagers here. So some of them won't have source code packaged and many of them won't have Javadocs.

In case you have a lot of dependencies it might also be a good idea to use inclusions/exclusions to get specific artifacts, the following command will for example only download the sources for the dependency with a specific artifactId:

mvn dependency:sources -DincludeArtifactIds=guava

来源:http://tedwise.com/2010/01/27/maven-micro-tip-get-sources-and-javadocs/

文档:https://maven.apache.org/plugins/maven-dependency-plugin/sources-mojo.html

关于java - 从 Maven 存储库获取源 JAR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2059431/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com