code: private ClassLoader getClassLoader() throws MojoExecutionException {
          Set<URL> classpathURLs = new LinkedHashSet<URL>();
          // project classpath must be first
          this.addRelevantProjectDependenciesToClasspath(classpathURLs);
          // and extra plugin classpath
          this.addExtraPluginDependenciesToClasspath(classpathURLs);
          // and plugin classpath last
          this.addRelevantPluginDependenciesToClasspath(classpathURLs);
  
          if (logClasspath) {
              getLog().info("Classpath:");
              for (URL url : classpathURLs) {
                  getLog().info("  " + url.getFile().toString());
              }
          }
          return new URLClassLoader(classpathURLs.toArray(new URL[classpathURLs.size()]));
      }
docs: Set up a classloader for the execution of the main class.
  
  @return the classloader
  @throws MojoExecutionException