in src/main/java/org/apache/maven/plugins/pmd/exec/PmdExecutor.java [65:79]
public static PmdResult execute(PmdRequest request) throws MavenReportException {
if (request.getJavaExecutable() != null) {
return fork(request);
}
// make sure the class loaders are correct and call this in the same JVM
ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(PmdExecutor.class.getClassLoader());
PmdExecutor executor = new PmdExecutor(request);
return executor.run();
} finally {
Thread.currentThread().setContextClassLoader(origLoader);
}
}