maven下载源码和javdocs!
2015-10-15 18:39
711 查看
1:Maven命令下载源码和javadocs
当在IDE中使用Maven时如果想要看引用的jar包中类的源码和javadoc需要通过maven命令下载这些源码,然后再进行引入,通过mvn命令能够容易的达到这个目的:</pre>mvn dependency:sourcesmvn dependency:resolve -Dclassifier=javadoc<pre>命令使用方法:首先进入到相应的pom.xml目录中,然后执行以上命令:
第一个命令是尝试下载在pom.xml中依赖的文件的源代码。
第二个命令:是尝试下载对应的javadocs
但是有可能一些文件没有源代码或者javadocs
然后在pom文件中添加如下代码,进行本地源码关联。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
然后在执行mvn eclipse:myeclipse-clean eclipse:myeclipse就ok了。
reference
2:通过配置文件添加
打开maven配置文件 setting.xml文件(.../.m2/settings.xml) 增加如下配置:[html] view
plaincopy
<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
版权声明:本文为博主原创文章,未经博主允许不得转载。
相关文章推荐
- 分享精心挑选的23款美轮美奂的jQuery 图片特效插件
- 浅析Mybatis 在CS程序中的应用
- Java Mybatis框架入门基础教程
- Java简单实现SpringMVC+MyBatis分页插件
- mybatis的动态sql详解(精)
- MyBatis入门学习教程(一)-MyBatis快速入门
- 解决springmvc+mybatis+mysql中文乱码问题
- maven中下载jar包源码和javadoc的命令介绍
- SpringMVC+MyBatis项目总结(一)
- SpringMVC+MyBatis项目总结(二)
- MyBatis返回结果不稳定
- MyBatis通过反射建立一个对象的过程。
- Maven学习笔记
- springMVC+spring+Mybatis
- SpringMVC+mybatis+Spring框架整合+简单实现的demo
- 《Maven权威指南》学习笔记五_Project Object Model(POM)
- 《Maven权威指南》学习笔记二十_关于POM
- Spring+mybatis+shiro+freemarker+ehcache+ldap+mongo
- 继续钟爱JdbcTemplate