maven 下载源码和javadoc命令

1、Maven命令下载源码和javadocs

当在IDE中使用Maven时如果想要看引用的jar包中类的源码和javadoc需要通过maven命令下载这些源码,然后再进行引入,通过mvn命令能够容易的达到这个目的:

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

命令使用方法:首先进入到相应的pom.xml目录中,然后执行以上命令:
第一个命令是尝试下载在pom.xml中依赖的文件的源代码。

第二个命令:是尝试下载对应的javadocs

但是有可能一些文件没有源代码或者javadocs

reference

2、通过配置文件添加
打开maven配置文件 setting.xml文件(.../.m2/settings.xml) 增加如下配置:

<profiles>
<profile>
    <id>downloadSources</id>
    <properties>
        <downloadSources>true</downloadSources>
        <downloadJavadocs>true</downloadJavadocs>           
    </properties>
</profile>
</profiles>
 
<activeProfiles>
  <activeProfile>downloadSources</activeProfile>
</activeProfiles>

3、配置eclipse

Window > Preferences > Maven and checking the "Download Artifact Sources" and "Download Artifact JavaDoc" options

--------------------- 
作者:bird_cat 
来源:CSDN 
原文:https://blog.csdn.net/topwqp/article/details/8902863 

猜你喜欢

转载自blog.csdn.net/yjclsx/article/details/84140101