1:Maven命令下载源码和javadocs

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

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

命令使用方法:首先进入到相应的pom.xml目录中,然后执行以上命令:

第一个命令是尝试下载在pom.xml中依赖的文件的源代码。

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

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

reference

Executing mvn dependency:sources will force maven to download all sources of all jars in the project, if the sources are available (are uploaded in the repository where the artifact is hosted). If you want to download javadoc the command is mvn dependency:resolve -Dclassifier=javadoc

http://stackoverflow.com/questions/11361331/how-to-download-sources-for-a-jar-with-maven

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
 
参考;
http://blog.csdn.net/topwqp/article/details/8902863
 

Maven编译报错 Unknown lifecycle phase "mvn" 解决办法

[ERROR] Unknown lifecycle phase "mvn". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

 搜索到一个靠谱的回答:

如果是eclipse继承环境,去掉mvn

 
 

maven中下载jar包源码和javadoc的更多相关文章

  1. maven下载jar包源码配置

    两个依赖,就想下mail的源码包,因该怎么 <dependencies> <dependency> <groupId>javax.mail</groupId& ...

  2. Eclipse_插件_05_自动下载jar包源码插件

    一.Java Source Attacher 1.下载 官网:http://marketplace.eclipse.org/content/java-source-attacher#.U5RmTePp ...

  3. 如何在idea中查看jar包源码

    文章目录 准备jar包 idea打开文件夹 最后一步 准备jar包 例如,我准备看resin的jar,在桌面准备了一份 idea打开文件夹 在idea中file====>open=====> ...

  4. 如何在maven中下载jar包

    1.进入maven网址  https://mvnrepository.com/ 2.搜索你想要的包的名字 3.找到列表中你想要的包 4.点击一个版本 5.点击 view all 6.找到你想要的包,点 ...

  5. IDEA反编译jar包源码

    1.maven 项目查看jar源码 如何在idea中查看jar包源码   文章目录 准备jar包 idea打开文件夹 最后一步 准备jar包 例如,我准备看resin的jar,在桌面准备了一份 ide ...

  6. 如何在maven中添加jar包

    Maven 中央仓库地址: 1. http://www.sonatype.org/nexus/ 2. http://mvnrepository.com/ (本人推荐仓库) 3. http://repo ...

  7. JAVAEE 是什么,如何获取各种规范jar包及各种规范的jar包源码

    1.什么是JAVA EE JAVA EE是由一系列规范组成的,规范是由JCP制定的,并且提供了参考实现.规范(Specification)是一系列接口,不包含具体实现 有以下常见的JAVA EE实现, ...

  8. Maven仓库下载jar包失败的处理方案

    Maven仓库下载jar包失败的处理方案 在使用Maven项目的时候,有时候中央仓库并没有对应的包比如kaptcha-2.3.2.jar: 为了使我们的 项目能够正常运行下去,我们可以去别的地方下载对 ...

  9. 如何从maven资源库下载jar包

      如何从maven资源库下载jar包 CreationTime--2018年6月7日09点00分 Author:Marydon 一.前提 需要安装并配置maven环境 二.准备工作 1.在桌面创建一 ...

随机推荐

  1. Oracle 删除重复行

    DELETE FROM your_table WHERE rowid not in (SELECT MIN(rowid) FROM your_table GROUP BY column1, colum ...

  2. SET ? DECLARE

    http://dev.mysql.com/doc/refman/5.7/en/declare-local-variable.html http://dev.mysql.com/doc/refman/5 ...

  3. oracle EBS 资产定义

    一.资产定义也就是江项目任务上的特定(能生成资产的)物料按照一定格式生成资产信息,其中每个独立物料生成一条资产,具体操作步骤如下: 1.省本部库存超级用户系统内生成领料单.审批领料单.最后进行出库处理 ...

  4. UML学习

    学习链接:http://blog.csdn.net/wangyongxia921/article/category/1293975 感谢原文作者.

  5. svn利用TortoiseSVN忽略文件或文件夹

    忽略已经版本控制的文件 如果你不小心添加了一些应该被忽略的文件,你如何将它们从版本控制中去除而不会丢失它们?或许你有 自己的IDE配置文件,不是项目的一部分,但将会花费很多时间使之按照自己的方式工作. ...

  6. android xUtils get post

    使用android xUtils框架,进行http的get和post验证. 参考链接: https://github.com/wyouflf/xUtils3 http://blog.csdn.net/ ...

  7. NSUserDefaults的小封装

    //保存 -(void)saveToUserDefaults:(NSString*)tosaveedString withKey:(NSString *)tosaveedKey {  NSUserDe ...

  8. Fast and Robust Hand Tracking Using Detection-Guided Optimization

    http://handtracker.mpi-inf.mpg.de/projects/FastHandTracker/

  9. 数据库字段Pointer的操作方法

    多数情况下要要是Pointer字段实现了类似传统关系数据库的关联操作,联合查询能够减少提交次数,今天带来几种过滤器的使用方法: 首先确定2个Class,也就是表: A表:user表,用户个人信息,字段 ...

  10. 30天,APP创业从0到1【7.26苏州站】

    活动概况 时间:2015年7月26日13:30-16:30 地点:创客巢(苏州吴中区玉山路646号金枫广告产业园B栋4楼) 主办:APICloud.融云.鱼多多 网址:www.apicloud.com ...