While I combine maven and vim , I can’t find a way to download all sources that my project depends to a specified directory and unpack them together.
So that i can generate tags easy.
Does someone know how to ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use the maven-eclipse-plugin plugin to download the sources, and give you a list of the source jars that are available (some of your dependencies might not have sources available).
The dependency plugin can also download sources, but it’s harder to get the list of jars you need.
You could try something like this:
This runs
mvn eclipse:eclipse -DdownloadSources, which will download the sources, and write a.classpathfile to the local directory. This file contains the paths to your source jars. It looks a bit like this:In my example, you can see that there are sources for the JCIP annotations jar, but not the FindBugs JSR305 jar.
The sed command extracts the paths of the source jars (relative to your maven local repository). The xargs command then unpacks each source jar into
$dir.The eclipse plugin creates the files
.classpathand.projectand a directory.settings– you can delete these if you never use Eclipse.