Class ContextClassLoaderExtender
- java.lang.Object
-
- biz.gabrys.maven.plugin.util.classpath.ContextClassLoaderExtender
-
public class ContextClassLoaderExtender extends Object
Responsible for adding Maven project dependencies to classpath.- Since:
- 1.4.0
-
-
Constructor Summary
Constructors Constructor Description ContextClassLoaderExtender(MavenProject project, Log logger)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependencies(String... types)
Adds all dependencies with specified types to context class loader.void
addDependencies(Collection<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 theArtifact
.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.
-
-
-
Constructor Detail
-
ContextClassLoaderExtender
public ContextClassLoaderExtender(MavenProject project, Log logger)
Creates a new instance.- Parameters:
project
- the Maven project.logger
- the logger.- Throws:
IllegalArgumentException
- if the Maven project or/and the logger is equal tonull
.- Since:
- 1.4.0
-
-
Method Detail
-
addDependencies
public void addDependencies(String... types)
Adds all dependencies with specified types to context class loader.- Parameters:
types
- the supported types.- Throws:
IllegalArgumentException
- if the types are equal tonull
.- Since:
- 1.4.0
-
addDependencies
public void addDependencies(Collection<String> types)
Adds all dependencies with specified types to context class loader.- Parameters:
types
- the supported types.- Throws:
IllegalArgumentException
- if the types collection is equal tonull
.- Since:
- 1.4.0
-
filterArtifacts
protected List<Artifact> filterArtifacts(Collection<Artifact> artifacts, Collection<String> types)
Filters artifacts based on the type.- Parameters:
artifacts
- the collection which stores artifacts.types
- the supported types.- Returns:
- the list with artifacts whose types fit to the supported types.
- Since:
- 1.4.0
-
resolveArtifactsUrls
protected List<URL> resolveArtifactsUrls(Collection<Artifact> artifacts)
Returns URLs whose represents artifacts.- Parameters:
artifacts
- the collection which stores artifacts.- Returns:
- the artifacts' URLs.
- Since:
- 1.4.0
-
addToContextClassLoader
protected void addToContextClassLoader(List<URL> urls)
Adds artifacts URLs to context class loader.- Parameters:
urls
- the artifacts URLs.- Since:
- 1.4.0
-
-