Walkmod plugin to resolve the classpath of a maven project before executing a code transformation. It builds the project and resolve all its dependencies. No matter if it is a maven module project or the classic maven project. In case of being a maven module, this plugin compiles and resolve the dependencies with the other modules of the same project.
Important, to run this plugin, you need to work with JRE 7 or higher.
Specifically, this plugin makes available the classpath of maven project for the code transformations when you run walkmod. In order to access to the project classpath (the java.lang.ClassLoader
element) from your code transformation, you just need to add
the setter operation for the class loader.
public class MyVisitor extends VisitorSupport {
private ClassLoader classLoader;
public void setClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
public void visit(MethodCallExpr md, VisitorContext vc){
...
}
In order to use this plugin from a project where you would like to run walkmod, you just need the following configuration provider in your walkmod.xml:
<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD" "http://www.walkmod.com/dtd/walkmod-1.1.dtd">
<walkmod>
<conf-providers>
<conf-provider type="maven"/>
</conf-providers>
</walkmod>