Skip to content

Instantly share code, notes, and snippets.

@gerjantd
Created May 7, 2012 10:50
Show Gist options
  • Save gerjantd/2627213 to your computer and use it in GitHub Desktop.
Save gerjantd/2627213 to your computer and use it in GitHub Desktop.
Maven: dynamically build classpath containing all maven dependencies
Download
--------
svn co https://src.springframework.org/svn/spring-samples/task-basic/trunk
(http://blog.springsource.org/2010/01/05/task-scheduling-simplifications-in-spring-3-0/)
Build
-----
mvn clean package
Run
---
java -classpath `mvn dependency:build-classpath|grep -v "\["`:target/org.springframework.samples.task.basic-1.0.0-SNAPSHOT.jar org.springframework.samples.task.basic.annotation.AnnotationDemo
java -classpath `mvn dependency:build-classpath|grep -v "\["`:target/org.springframework.samples.task.basic-1.0.0-SNAPSHOT.jar org.springframework.samples.task.basic.xml.XmlDemo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment