I tried my best to use your solution but it did not work for me. I wonder if it is because the repository I point at
Code:
http://mvnrepository.com/artifact/org.springframework/spring-parent/3.0.2.RELEASE
... for example ....
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
does not have the Spring source code. Maybe the Spring source code is only kept in that other maven repository that Spring privately owns?
My first attempt at running
Code:
mvn eclipse:clean eclipse:eclipse -DeclipseDownloadSources=true
resulted in:
Code:
Scanning for projects...
Searching repository for plugin with prefix: 'eclipse'.
------------------------------------------------------------------------
Building UESS
task-segment: [eclipse:clean, eclipse:eclipse]
------------------------------------------------------------------------
[eclipse:clean]
Deleting file: .project
Deleting file: .classpath
Deleting file: .wtpmodules
Deleting file: .component
Deleting file: org.eclipse.wst.common.component
Deleting file: org.eclipse.wst.common.project.facet.core.xml
Deleting file: org.eclipse.jdt.core.prefs
Preparing eclipse:eclipse
No goals needed for project - skipping
[eclipse:eclipse]
Adding support for WTP version 1.5.
Using source status cache: C:\icd\ews\uesm_2010_02_25\UESS\target\mvn-eclipse-cache.properties
Wrote settings to C:\icd\ews\uesm_2010_02_25\UESS\.settings\org.eclipse.jdt.core.prefs
Wrote Eclipse project for "UESS" to C:\icd\ews\uesm_2010_02_25\UESS.
------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 1 second
Finished at: Tue Apr 27 09:33:47 EDT 2010
Final Memory: 9M/508M
------------------------------------------------------------------------
Well of course the source did not download in 1 second, the time it took for that build.
So, I looked at
Code:
http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html
and found this documentation for "downloadSources" :
Code:
Enables/disables the downloading of source attachments.
Defaults to false. When this flag is true remote repositories are
checked for sources: in order to avoid repeated check for
unavailable source archives, a status cache is mantained.
With versions 2.6+ of the plugin to reset this cache run
mvn eclipse:remove-cache, or use the forceRecheck option
with versions. With older versions delete the file mvn-eclipse-cache.properties
in the target directory.
I tried both suggestion above (deleting mvn-eclipse-cache.properties) and running "mvn eclipse:remove-cache".
Neither helped. The Spring source code did not download into my local Maven Repository (assuming that's where it would be placed).
I am using m2Eclipse but I could not find any option to check that indicated it would download source. The eclipse version is 3.4.1.
Looking at the "About Eclipse Platform Plug-ins", the Sonatype m2eclipse seems to be version 0.9.7.