Extracting Maven classpath from configuration

I need to find the classpath for maven somehow, i.e. all dependencies, etc., and use it as part of the config for the plugin. Here's an example



Unfortunately, the $ {maven.runtime.classpath} property is empty. Is there anything that is equivalent to this?


source to share

2 answers

The easiest way is to use something like groovy and configure it programmatically.

Here is the configuration to be enabled.


                    import org.codehaus.plexus.util.StringUtils;
                    import java.io.File;

                    System.setProperty("your.classpath.property", StringUtils.join(project.getRuntimeClasspathElements().iterator(), File.pathSeparator));






I'm not sure why the classpath is empty, maybe this will help: http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html



All Articles