@Component(role=DependencyDownloader.class, hint="default") public class DependencyDownloader extends Object
The downloader must be initialized by calling init(ProjectBuildingRequest, List, Log) before any of its other methods my be used.
This class only works for maven versions >=3.1
| Constructor and Description |
|---|
DependencyDownloader() |
| Modifier and Type | Method and Description |
|---|---|
void |
downloadArtifacts(Collection<ArtifactWithRepoType> artifacts) |
void |
enableDownloadJavadoc() |
void |
enableDownloadSources() |
List<Exception> |
getErrors() |
void |
init(org.apache.maven.project.ProjectBuildingRequest buildingRequest,
List<org.apache.maven.project.MavenProject> reactorProjects,
org.apache.maven.plugin.logging.Log logger)
Initialize the DependencyDownloader
|
Set<ArtifactWithRepoType> |
resolveDependencies(org.apache.maven.project.MavenProject project)
Download all dependencies of a maven project including transitive dependencies.
|
Set<ArtifactWithRepoType> |
resolveDynamicDependency(DynamicDependency dynamicDependency)
Download a single dependency and all of its transitive dependencies that is needed by the build without appearing in any dependency tree
|
Set<ArtifactWithRepoType> |
resolvePlugin(org.apache.maven.model.Plugin plugin)
Download a plugin, all of its transitive dependencies and dependencies declared on the plugin declaration.
|
public void init(org.apache.maven.project.ProjectBuildingRequest buildingRequest,
List<org.apache.maven.project.MavenProject> reactorProjects,
org.apache.maven.plugin.logging.Log logger)
buildingRequest - a buildingRequest containing the maven session and Repositories to be used to download artifactsreactorProjects - the reactorProjects of the current build used to exclude reactor artifacts from the dependency download.logger - used to log infos and warnings.public void enableDownloadSources()
public void enableDownloadJavadoc()
public void downloadArtifacts(Collection<ArtifactWithRepoType> artifacts)
public Set<ArtifactWithRepoType> resolveDependencies(org.apache.maven.project.MavenProject project)
project - the project to download the dependencies for.public Set<ArtifactWithRepoType> resolvePlugin(org.apache.maven.model.Plugin plugin)
Dependencies and plugin artifacts that refer to an artifact in the current reactor build are ignored. Transitive dependencies that are marked as optional are ignored Transitive dependencies with the scopes "test", "system" and "provided" are ignored.
plugin - the plugin to downloadpublic Set<ArtifactWithRepoType> resolveDynamicDependency(DynamicDependency dynamicDependency)
Dependencies and plugin artifacts that refer to an artifact in the current reactor build are ignored. Transitive dependencies that are marked as optional are ignored Transitive dependencies with the scopes "test", "system" and "provided" are ignored.
dynamicDependency - the dependency to downloadCopyright © 2018–2020 QAware GmbH. All rights reserved.