在使用maven管理项目的时候,涉及一些框架的源代码是没有办法查看的,还需要自己下载导入源文件,现解决maven管理项目如何下载源文件 1、命令行方法:首先进入项目pom.xml目录中,然后执行 mvn dependency:sources(尝试现在pom.xml中以来的文件源代码) mvn dependency:resolve -Dclassifier=javadoc(下载对应的javadocs) 2、通过配置文件添加 打开maven的配置文件setting.xml(路径:maven安装路径下面的conf文件夹中)增加如下节点:
<profile>
<profile>
<id>downloadSources
</id>
<properties>
<downloadSources>true
</downloadSources>
<downloadJavadocs>true
</downloadJavadocs>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>downloadSources
</activeProfile>
</activeProfiles>
3、配置eclipse
配置完之后重新编译项目即可
声明:如有更好解决方法或任何问题,评论或者私信我均可,谢谢大家,祝好运。
转载请注明原文地址: https://ju.6miu.com/read-1044.html