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 的 ...
随机推荐
- UVALive-3415 Guardian of Decency (最大独立集)
题目大意:一个老师要带一些学生去春游,但是要带的学生中任意两个人都满足下面四个条件中的至少一个:1.性别相同:2.身高差大与40公分:3.最喜欢的音乐类型不同:4.最喜欢的体育运动相同.问老师最多能带 ...
- memcache+tomcat7.0.37+nginx实现session共享
一.session工作原理 由于http是无状态的协议,当我们访问了页面A,然后访问页面B,http无法确定这2个页面的访问是来自同一个人.因此,我们要用cookie或session来跟踪用户,根据授 ...
- openResty缓存前移(到达nginx端)
一.openResty的理解 OpenResty是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用于方便地搭建能够处理超高 ...
- ASP.NET FORM认证配置排错记录
搞了2小时都不能实现自动跳转到登录页面,后删除了配置文件中的name,就解决问题了. <authorization> <deny users="?" / ...
- 'mysql'不是内部或外部命令,也不是可运行的程序或批处理文件.
'mysql'不是内部或外部命令,也不是可运行的程序或批处理文件. 今天中午新换了一个系统,重装了一下wampserver2.2.下午想导入一个数据库文件打开dos,输入MySQL -u root - ...
- Ethereum以太网搭建本地开放环境简明教程
引言: 区块链技术的风起云涌预示着一个去中心化时代的来临,ethereum技术栈是目前业界最为应用广泛的基于区块链技术的技术方案,本文将记录如何基于本地环境来搭建私有区块链的开发环境. 部署私有区块链 ...
- np.ones(N)/N的作用
在python中导入numpy包 N=5 weights = np.ones(N)/N //这里就相当于创建了一个数组,且为5个1/5的数组 print "weights&quo ...
- UVA之1121 - Subsequence
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/SunnyYoona/article/details/25840365 [题目] A sequence ...
- 用ASP.Net(C#)连接Oracle数据库的方法及实例
今天看了一下asp.net连接oracle数据库的方法,得到了如下代码.这段代码打开了MyTable表,并把操作员的名字列出.字段类型是OracleString.读取的时候用的是字段编号,我不知道怎么 ...
- ETA6093 或 ETA9741 ETA9742 的 TYPE-C 的资料收集
ETA6093 或 ETA9741 ETA9742 的 TYPE-C 的资料收集 因为项目使用. 这个 IC 好玩,但是还是有一些需要注意的. 对我有用的信息. http://www.great-et ...