code: private URL[] generateClassPathUrls() throws MojoExecutionException {
          List<URL> urls = new ArrayList<URL>();
          URL url;
          try {
              for (Object element : getCompileClasspath()) {
                  String path = (String) element;
                  if (path.endsWith(".jar")) {
                      url = new URL("jar:" + new File(path).toURI().toString() + "!/");
                  } else {
                      url = new File(path).toURI().toURL();
                  }
                  urls.add(url);
              }
          } catch (MalformedURLException e) {
              throw new MojoExecutionException("Could not set up classpath", e);
          }
          return urls.toArray(new URL[urls.size()]);
      }
docs: Generates a URL[] with the project class path (can be used by a
  URLClassLoader)
  
  @return the array of classpath URL's
  @throws MojoExecutionException