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-1601 The Morning after Halloween(BFS或双向BFS)
题目大意:在一张图中,以最少的步数将a,b,c移到对应的A,B,C上去.其中,每个2x2的方格都有障碍并且不能两个小写字母同时占据一个格子. 题目分析:为避免超时,先将图中所有能联通的空格建起一张图, ...
- C#接口作用
1.C#接口的作用 : C#接口是一个让很多初学C#者容易迷糊的东西,用起来好像很简单,定义接口,里面包含方法,但没有方法具体实现的代码,然后在继承该接口的类里面要实现接口的所有方法的代码,但没有真正 ...
- wikioi 1035 火车停留 裸费用流
链接:http://wikioi.com/problem/1035/ 怎么说呢,只能说这个建图很有意思.因为只有m条道,然后能互相接在一起的连通,对每个点进行拆点,很有意思的一道裸费用留题. 代码: ...
- vue.js 源代码学习笔记 ----- text-parse.js
/* @flow */ import { cached } from 'shared/util' import { parseFilters } from './filter-parser' //找到 ...
- 转:Android-apt
转自http://blog.csdn.net/zjbpku/article/details/22976291 What is this? The Android-apt plugin assists ...
- react 拖拽排序---原生
定义css, 两个动画 .drag-up { -webkit-animation: dragup ease 0.2s 1; animation: dragup ease 0.2s 1; -webkit ...
- W: GPG error: http://dl.google.com/linux/chrome/deb stable Release: The following signatures couldn'
Ubuntu 16.04.2执行 sudo apt-get update .警告如下:W: GPG error: http://dl.google.com/linux/chrome/deb stabl ...
- yaf 笔记(持续更新)
1.如果action不需要输出视图文件(如果ajax请求之类的),只需要在action里面加Yaf\DisPatcher::getInstance()->disableView(); 2.获取客 ...
- Hibernate对象的三种状态,瞬时态、持久态、游离态
1.瞬时态.(new完一个对象,突然断电,内存中没有此对象) hibernate中什么时候的对象为瞬时态呢,当我们new 一个对象时,还没有save时,它就是瞬时态的,当我们delete一个对象时,它 ...
- BZOJ2140: 稳定婚姻(tarjan解决稳定婚姻问题)
2140: 稳定婚姻 Time Limit: 2 Sec Memory Limit: 259 MBSubmit: 1321 Solved: 652[Submit][Status][Discuss] ...