Maven is an amazing piece of software, despite all the criticism it has endured it is fascinating to me. However there is one short line that has made life so much easier for me:
mvn -Declipse.downloadSources=true
This tells maven to download all associated sources of jar files in the pom.xml. Amazing, how much easier it is to set up a project with proper debugging sources etc. There is even a cool eclipse integration available over at codehaus.org.








There’s an easier way if you use m2eclipse:
In the Eclipse preferences, look for Maven.
There you can configure two things:
- Download Artifact Sources
- Download Artifact JavaDoc
Now whenever you specify a new dependency with m2eclipse, it downloads everything right from the start.
Just right-click on the Eclipse project, choose Maven… Add Dependency…
Then choose your dependency (if you have configured a repository with an index). It will be downloaded together with the sources and JavaDoc, and everything will be attached automatically by m2eclipse (check the Project’s build path).
Yeah, using an IDE tool makes certain things easier. Although I found both m2eclipse and Q4E somewhat buggy. Still a long way to go to maturity, that’s why it’s a good idea to familiarize yourself with the command line as well.