public class ArtifactResolver extends Object
Constructor and Description |
---|
ArtifactResolver(boolean isOffline,
boolean isDebug,
RepositoryResolver repositoryResolver) |
Modifier and Type | Method and Description |
---|---|
Collection<org.eclipse.aether.resolution.ArtifactResult> |
getArtifactDependencies(org.eclipse.aether.artifact.Artifact artifact,
List<org.eclipse.aether.artifact.Artifact> dependentArtifacts) |
Collection<org.eclipse.aether.resolution.ArtifactResult> |
getDistributionDependencies(String xwikiVersion,
List<org.eclipse.aether.artifact.Artifact> extraArtifacts) |
org.eclipse.aether.resolution.ArtifactResult |
resolveArtifact(org.eclipse.aether.artifact.Artifact artifact)
Resolve the passed artifact (will resolve against the remote and local repositories and ensure that the file is
available on the local file system).
|
public ArtifactResolver(boolean isOffline, boolean isDebug, RepositoryResolver repositoryResolver)
isOffline
- if true then don't go out to resolve artifactsisDebug
- if true then display debugging messages in the standard outputrepositoryResolver
- the resolver to create Maven repositories and sessionspublic org.eclipse.aether.resolution.ArtifactResult resolveArtifact(org.eclipse.aether.artifact.Artifact artifact) throws Exception
Example usage:
Artifact resourceArtifact =
new DefaultArtifact("org.xwiki.platform", "xwiki-platform-tool-configuration-resources",
"jar", "10.7-SNAPSHOT");
artifact
- the artifact to resolve (will resolve against the remote and local repositories and ensure that
the file is available on the local file system)Exception
- if an error occurred during resolvingpublic Collection<org.eclipse.aether.resolution.ArtifactResult> getArtifactDependencies(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.artifact.Artifact> dependentArtifacts) throws Exception
artifact
- the artifact for which to resolve its dependencies (will resolve against the remote and local
repositories and ensure that files are available on the local file system for the artifact's dependencies)dependentArtifacts
- additional dependencies for which to also find dependencies in the same requestException
- if an error occurred during resolvingpublic Collection<org.eclipse.aether.resolution.ArtifactResult> getDistributionDependencies(String xwikiVersion, List<org.eclipse.aether.artifact.Artifact> extraArtifacts) throws Exception
xwikiVersion
- the version of the artifacts to resolveextraArtifacts
- the list of extra artifacts that should be added to WEB-INF/lib
. Can be emptyException
- if an error occurred during resolvingCopyright © 2004–2019 XWiki. All rights reserved.