1.只下载项目的sources 和 javadoc(省时间)
在pom.xml
<build>
<finalName>spring-security-loginform-database</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</build>
2.本地仓库下载 sources 和javadoc
setting.xml
<profiles>
<profile>
<id>downloadSources</id>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>downloadSources</activeProfile>
</activeProfiles>
或者可以采取命令行:
mvn dependency:sources
mvn dependency:sources -DdownloadSources=true -DdownloadJavadocs=true
-DdownloadSources=true 下载源代码Jar -DdownloadJavadocs=true 下载javadoc包
http://www.itzhai.com/use-maven-manage-jar-and-lookup-sourcecode.html
参考:
http://stackoverflow.com/questions/2059431/get-source-jars-from-maven-repository
http://blog.csdn.net/topwqp/article/details/8902863