public class ContextClassLoaderExtender extends Object
Constructor and Description |
---|
ContextClassLoaderExtender(MavenProject project,
Log logger)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addDependencies(Collection<String> types)
Adds all dependencies with specified types to context class loader.
|
void |
addDependencies(String... types)
Adds all dependencies with specified types to context class loader.
|
protected void |
addToContextClassLoader(List<URL> urls)
Adds artifacts URLs to context class loader.
|
protected String |
createDisplayText(Artifact artifact)
Creates a text representation of the
Artifact . |
protected List<Artifact> |
filterArtifacts(Collection<Artifact> artifacts,
Collection<String> types)
Filters artifacts based on the type.
|
protected List<URL> |
resolveArtifactsUrls(Collection<Artifact> artifacts)
Returns URLs whose represents artifacts.
|
public ContextClassLoaderExtender(MavenProject project, Log logger)
project
- the Maven project.logger
- the logger.IllegalArgumentException
- if the Maven project or/and the logger is equal to null
.public void addDependencies(String... types)
types
- the supported types.IllegalArgumentException
- if the types are equal to null
.public void addDependencies(Collection<String> types)
types
- the supported types.IllegalArgumentException
- if the types collection is equal to null
.protected List<Artifact> filterArtifacts(Collection<Artifact> artifacts, Collection<String> types)
artifacts
- the collection which stores artifacts.types
- the supported types.protected List<URL> resolveArtifactsUrls(Collection<Artifact> artifacts)
artifacts
- the collection which stores artifacts.protected void addToContextClassLoader(List<URL> urls)
urls
- the artifacts URLs.Copyright © 2015–2016 gabrys.biz. All rights reserved.