All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javalite.activeweb.mojo.ClassPathUtil Maven / Gradle / Ivy

Go to download

This plugin will generate Open API - compliant document from sources of an ActiveWeb app.

There is a newer version: 3.3
Show newest version
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