private List < URL > buildURLs ( final Collection < Artifact > classpathElements ) throws ComponentConfigurationException { final List < URL > urls = new ArrayList < URL > ( classpathElements . size ( ) ) ; for ( final Artifact classpathElement : classpathElements ) { try { final URL url = classpathElement . getFile ( ) . toURI ( ) . toURL ( ) ; urls . add ( url ) ; } catch ( final MalformedURLException e ) { throw new ComponentConfigurationException ( "Unable to access project dependency: " + classpathElement , e ) ; } } return urls ; }
Retrive the URLs used to locate the JAR files for a list of artifacts .