Archive

Archive for December, 2009

How to download dependencies sources via Maven

December 10, 2009 Leave a comment

You can use the dependency plugin adding this to your pom.xml  (i’ve reported the pom’s build section):

....
<build>

<finalName>booking-mvc</finalName>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<configuration>

<source>1.5</source>

<target>1.5</target>

</configuration>

</plugin>
<!-- you have to insert this plugin definition-->
<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-dependency-plugin</artifactId>

</plugin>

</plugins>

</build>

...
then you can use the command mvn dependency:sources.
The sources will be downloaded into the mvn local repository, together with the dependency itself.
This is very useful with maven modules in intellij idea because it links automatically sources and jars, configuring debugging too.
Advertisements
Categories: Uncategorized