Friday, November 21, 2008

Just a quick note.... Maven + dependencies + classpath

Just wanted to capture this for personal purpose...

How to find out/export the classpath from a maven project so that it can be used from scripts etc?

-- Using the build-classpath goal of the Maven dependency plugin.

The parameter name
given at the usage of this goal is deprecated and does not work. Its recommended to use the ouputFile parameter instead.

So some examples...
mvn dependency:build-classpath

prints the classpath in the console... and
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt

puts the classpath in the file called cp.txt

No comments:

Post a Comment