Download/Attach source-code/java-docs with maven dependencies
I am using Maven in my projects from last couple of years, and the automatically downloading the Jars from repository feature of maven is really helpful for developers. But If you are using Eclipse and want to read/analyse Source Code or Java Doc of API then you need the jar file that contains the Source code and java doc of the API, but unfortunately maven does not download and attach the source code and java doc of the APIs automatically.
Maven provides some different ways to download and attach that source code and Java Doc:
- Using maven eclipse plugin
- Using maven dependency plugin
Note: The sources and javadocs of the libraries must exist in the repository so that the plugin can download it and attach it.
1. Maven eclipse plugin:
Maven dependencies that are deployed with the source and javadocs can be downloaded and attached to the Eclipse library by using maven-eclipse-plugin. It can be done by:
- passing command-line argument to the maven-eclipse-plugin, or
- by declaring in the pom.xml
1.1 passing command-line argument to maven-eclipse-plugin:
This example shows that how to do this by passing command line argument to the maven-eclipse-plugin:
mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
1.2 declaring in the pom.xml
This sample pom shows that how to declare downloadSources and downloadJavadocs configuration in pom.xml
<project>
…
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plgins>
</build>
…
</project>
2. Maven dependency plugin:
maven-dependency-plugin provides a goal named sources that resolves the project source dependencies from the repository.
usage:
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
This is useful when you want the source attachments downloaded to your local repository and you don’t want to use the eclipse plugin to do this since the eclipse plugin creates/overwrites the eclipse files.
Download/Attach source-code/java-docs with maven dependencies的更多相关文章
- Attach source code to a Netbeans Library Wrapper Module
http://rubenlaguna.com/wp/2008/02/22/attach-source-code-to-a-netbeans-library-wrapper-module/ Attach ...
- Spring 4 MVC example with Maven - [Source Code Download]
In this tutorial, we show you a Spring 4 MVC example, using Maven build tool. Technologies used : Sp ...
- maven下载源码和java docs
方法一: mvn dependency:sources mvn dependency:resolve -Dclassifier=javadoc The first command will attem ...
- How to build the Robotics Library from source code on Windows
The Robotics Library is an open source C++ library for robot kinematics, motion planning and control ...
- [转]Native Java Bytecode Debugging without Source Code
link from:http://www.crowdstrike.com/blog/native-java-bytecode-debugging-without-source-code/index.h ...
- Artistic Style 3.1 A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective‑C, C#, and Java Source Code
Artistic Style - Index http://astyle.sourceforge.net/ Artistic Style 3.1 A Free, Fast, and Small Aut ...
- Java Sound : generate play sine wave - source code
转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-sound-generate-play-sine-wave.html Work ...
- Sound (audio file) player in java - working source code example
转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/sound-audio-file-player-in-java-working.html ...
- VS Code Java 3月更新|代码补全、Maven 以及 Java 插件预览版本新升级!
Nick Zhu Senior Program Manager, Developer Division at Microsoft 大家好,欢迎来到 Visual Studio Code Java 的 ...
随机推荐
- UVA-11988 Broken Keyboard (a.k.a. Beiju Text) (链表 或 递归)
题目大意:将一个字符串改变顺序后输出.遇到“[”就将后面内容拿到最前面输出,遇到“]”就将后面的内容拿到最后面输出. 题目分析:用nxt[i]数组表示i后面的字符的下标,实际上就是以字符i为头建立链表 ...
- SQL语法语句总结(《SQL必知必会》读书笔记)
一.SQL语句语法 ALTER TABLE ALTER TABLE 用来更新已存在表的结构. ALTER TABLE tablename (ADD|DROP column datatype [NULL ...
- html和js实现滚动条效果
HTML部分 <!-- 遮罩层 --> <div id="zzc" style="z-index:-1;height:100%;width: 100%; ...
- 各种liunx发行版本包管理器对比
关于Ubuntu安装软件问题:apt-get和dpkg区别? 两者的区别是dpkg绕过apt包管理数据库对软件包进行操作,所以你用dpkg安装过的软件包用apt可以再安装一遍,系统不知道之前安装过了, ...
- 集成学习之Boosting —— Gradient Boosting原理
集成学习之Boosting -- AdaBoost原理 集成学习之Boosting -- AdaBoost实现 集成学习之Boosting -- Gradient Boosting原理 集成学习之Bo ...
- 网站微信登录-python 实现
最近微信登录开放公测,为了方便微信用户使用,我们的产品也决定加上微信登录功能,然后就有了这篇笔记. 根据需求选择相应的登录方式 微信现在提供两种登录接入方式 移动应用微信登录 网站应用微信登录 这里我 ...
- Chrome浏览器中使用 iframe 嵌入网页导致视频不能全屏的问题解决方法
今天无意中测试了下在 iframe 中嵌入视频, 发现全屏按钮在 Chrome 浏览器中居然无效, 试了好几个视频网站的视频都不能全屏, 但在其他浏览器中似乎都很正常, 应该是 Chrome 60 新 ...
- 使用 Windows 10 中的加速度计(Accelerometer,重力传感器)
在做 UWP 应用开发的时候还有什么理由可以用到加速度计呢?场景很多啦,比如做游戏,做类似 Surface Hub 那种一边旋转,一边所有内容跟着一起转的效果. Windows 10 UWP 中的加速 ...
- 【传输协议】http协议GET与POST传递数据的最大长度能够达到多少
各种web开发语言中,各个页面之间基本都会进行数据的传递,web开发里面比较常用的数据传递方式有get post,一直以来我都只知道get传递的数据量要比post传递的数据量要少,所以传递大数据量还是 ...
- TypeScript学习笔记(五) - 泛型
本篇将介绍在TypeScript如何使用泛型. 一.泛型方法 在TypeScript里,声明泛型方法有以下两种方式: function generics_func1<T>(arg: T): ...