Solution found:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> <executions> <execution> <id>get-dependency-sources</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${sources.directory}</outputDirectory> <classifier>sources</classifier> <prependGroupId>true</prependGroupId> </configuration> </execution> </executions> </plugin>
in combination with
<plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <id>unpack-sources</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <move todir="${sources.directory}"> <fileset dir="${sources.directory}"> <include name="**/*.jar"/> </fileset> <mapper type="glob" from="*.jar" to="*.zip"/> </move> </target> </configuration> </execution> ...
First collects all resources within ${sources.directory} and then renames the jars to zip files (which enables a "normal" user to view their contents in Windows Explorer. Alternatively you can also directly unzip the jars using the unzip ANT task.
dependency:sourcesresolves the sources for all dependencies of your project (including transitive ones). So Im not sure why you're saying it isn't recursive.