To get the classpath all by itself in a file, you can:
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
Or add this to the POM.XML:
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>build-classpath</id>
<phase>generate-sources</phase>
<goals>
<goal>build-classpath</goal>
</goals>
<configuration>
<!-- configure the plugin here -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
From: http://maven.apache.org/plugins/maven-dependency-plugin/usage.html