views:

2048

answers:

3

Hi,

I'd like to set a property in my pom to a classpath containing all the project's dependencies. The ant plugin does something like this, so I know it's definitely possible.

I basically want to use ${maven.compile.classpath} wherever I like in my pom and have it 'just work'. I don't mind using plugins or anything else to achieve this.

Many thanks,

Nick

+2  A: 

I don't think that there's a way of doing this without writing your own maven plugin. That said, you can get at the classpath using dependency:build-classpath. Is that of use?

Dominic Mitchell
+1  A: 

I second the dependency:build-classpath suggestion. It won't put it into a property currently but could easily be modified to do so. (patches accepted)

Brian Fox
A: 

Is there a plugin already that can set the classpath as a pom property?

Dave