The eclipse IDE plugin (http://m2eclipse.codehaus.org/) has an option to automatically download the sources for project dependencies.
Or if you want to do it from the command line, you can use the dependency plugin
Shouldn't maven do this by default when dependencies are resolved?
Now I end up with:
-rw-r--r-- 1 carlo carlo 326543 Oct 12 19:06 jbossxb-2.0.0-SNAPSHOT-sources.jar -rw-r--r-- 1 carlo carlo 439274 Oct 22 09:21 jbossxb-2.0.0-SNAPSHOT.jar
Which are out of sync.
The different timestamps are just when they were created locally, so I don't think they are out of sync as far as content. If you want to make the timestamps match, you could first do
That should clear out your project dependencies from the local repo, and then you can download them again with the correct timestamps.
I'm not sure why maven doesn't download sources by default when they are available. Maybe because it would slow down the initial build a little bit if you just want to build and don't care about the sources.
I know they're out of sync, because a new snapshot was uploaded. :-)
The timestamps are just another indicator.
I vote for enabling download of source by default in parent pom.
Can I enable this by default in my local settings.xml?
There isn't any way to do it from settings.xml. You can use
Other than that I think you would have to modify the pom to have it done automatically.