Sunday, August 12, 2007

Maven Download Sources

When using maven, it normally downloads only the binaries from the dependencies your project has.
It is possible, with simple commands, to also download the source and/or documentation from the dependencies you are interested in.

To download sources:

mvn [goal] -DdownloadSources=true

To download javadocs:
mvn [goal] -DdownloadJavadocs=true


Anonymous said...

Sorry, doesn't work for me (with maven2).

Daniel said...

Why don't you post the error message you are getting so we can try and help you?

Anonymous said...

I use it always with the 'eclipse:eclipse' or 'idea:idea' goals. Not sure if it works with other goals.

Gaurav said...

For me its working using mvn eclipse:eclipse -DdownloadSources

Andy Lynch said...

That option only works on the eclipse plugin; a better way is to use the dependency plugin:

mvn dependency:sources