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 的 ...
随机推荐
- TVD$XTAT在linux下安装使用详解
扩展跟踪文件分析工具 (TVD$XTAT)是个命令行工具.和TKPROF一样,主要目的是把原始跟踪文件作为输入内容生成一个格式化的文件作为输出内容.输出文件可以是HTML或是文本文件.界面非常友好,推 ...
- 最小生成树prim和kruskal模板
prim: int cost[MAX_V][MAX_V]; //cost[u][v]表示边e=(u,v)的权值(不存在的情况下设为INF) int mincost[MAX_V]; //从集合X出发的每 ...
- Deploying Qt or how to avoid “could not find or load the Qt platform plugin”
(转自:http://www.tripleboot.org/?p=138) Once you’ve built your first Qt program, have you tried it on ...
- C语言----------链表的简单实现与操作
链表是一种物理存储单元上非连续.非顺序的存储结构,数据元素的逻辑顺序是通过链表中的指针链接次序实现的. 链表由一系列结点(链表中每一个元素称为结点)组成,结点可以在运行时动态生成. 每个结点包括两个部 ...
- TStringGrid的Rows索引值 和 Cells的 索引值, Row的赋值
Caption := sgShopList.Rows[sgShopList.RowCount +].CommaText; Caption := sgShopList.Rows[sgShopList.R ...
- fcntl 改变描述符属性
body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...
- SpringMvc中的Interceptor拦截器的学习
拦截器是SpringMvc框架中常用的一个东东,它跟Filter相似,但是也有区别,以前也没用过,今天看到就顺便学习了一下. SpirngMvc中的Interceptor主要是通过HandlerInt ...
- 判断一棵树是否为二叉搜索树(二叉排序树) python
输入一棵树,判断这棵树是否为二叉搜索树.首先要知道什么是排序二叉树,二叉排序树是这样定义的,二叉排序树或者是一棵空树,或者是具有下列性质的二叉树: (1)若左子树不空,则左子树上所有结点的值均小于它的 ...
- name_save matlab
file=dir('/home/wang/Desktop/trainset/num0/');for i=3:length(file) path= strcat('/home/wang/Desk ...
- SpringBoot实现网站注册,邮件激活码激活功能
项目源码:https://gitee.com/smfx1314/springbootemail 上一篇文章已经讲到如何springboot如何实现邮件的发送,趁热打铁,这篇文章实现如下功能. 很多网站 ...