org.javalite.activeweb.mojo.ClassPathUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aw-mate Show documentation
Show all versions of aw-mate Show documentation
This plugin will generate Open API - compliant document from sources of an ActiveWeb app.
package org.javalite.activeweb.mojo;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.project.MavenProject;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
public class ClassPathUtil {
protected static ClassLoader getCombinedClassLoader(MavenProject project) throws DependencyResolutionRequiredException, MalformedURLException {
ClassLoader pluginCL = Thread.currentThread().getContextClassLoader();
URL[] urls = new URL[project.getCompileClasspathElements().size()];
for(int x = 0 ; x < urls.length; x++){
urls[x] = new File(project.getCompileClasspathElements().get(x).toString()).toURI().toURL();
}
return new URLClassLoader(urls, pluginCL);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy