Class DependencyResolver
java.lang.Object
de.iip_ecosphere.platform.configuration.maven.DependencyResolver
Simple Maven (snapshot) dependency resolver. For sure, there are better and easier ways...
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInformation needed for dependency resolution. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DependencyResolver.Callerprivate Set<org.apache.maven.artifact.Artifact> private static final org.apache.maven.artifact.handler.ArtifactHandler -
Constructor Summary
ConstructorsConstructorDescriptionCreates a dependency resolver with caller information. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the resolver for reuse.private org.eclipse.aether.artifact.DefaultArtifactcreateAetherArtifact(org.apache.maven.artifact.Artifact artifact) Creates an aether artifact for a maven artifact.static org.apache.maven.artifact.ArtifactcreateArtifact(String artifact, String scope) Creates an artifact instance.org.apache.maven.project.MavenProjectcreateMavenProject(org.apache.maven.artifact.Artifact artifact) Creates a Maven project instance.private booleanhasChanged(org.apache.maven.artifact.Artifact artifact, Predicate<File> since) Returns whether the given (snapshot)artifactor its dependencies has changedsince.booleanhaveDependenciesChangedSince(List<String> artifacts, Predicate<File> since) Returns whether at least one of the given (snapshot)artifactsor its (snapshot) dependencies has changedsince.org.apache.maven.artifact.Artifactresolve(org.apache.maven.artifact.Artifact artifact) Tries to resolveartifact.
-
Field Details
-
JAR_HANDLER
private static final org.apache.maven.artifact.handler.ArtifactHandler JAR_HANDLER -
caller
-
done
-
-
Constructor Details
-
DependencyResolver
Creates a dependency resolver with caller information.- Parameters:
caller- the caller
-
-
Method Details
-
resolve
public org.apache.maven.artifact.Artifact resolve(org.apache.maven.artifact.Artifact artifact) Tries to resolveartifact.- Parameters:
artifact- the artifact to resolve- Returns:
- the resolved artifact, null for none
-
createAetherArtifact
private org.eclipse.aether.artifact.DefaultArtifact createAetherArtifact(org.apache.maven.artifact.Artifact artifact) Creates an aether artifact for a maven artifact.- Parameters:
artifact- the maven artifact- Returns:
- the aether artifact
-
hasChanged
Returns whether the given (snapshot)artifactor its dependencies has changedsince. Stops artifact checking/resolution as soon as possible.- Parameters:
artifact- the artifactsince- the change predicate- Returns:
trueif one artifact changed,falseelse
-
createMavenProject
public org.apache.maven.project.MavenProject createMavenProject(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.project.ProjectBuildingException Creates a Maven project instance.- Parameters:
artifact- the artifact to return the Maven project instance for- Returns:
- the Maven project instance, may be null if
artifactis null - Throws:
org.apache.maven.project.ProjectBuildingException- if the project cannot be created
-
haveDependenciesChangedSince
Returns whether at least one of the given (snapshot)artifactsor its (snapshot) dependencies has changedsince. Stops artifact checking/resolution as soon as possible.- Parameters:
artifacts- the artifactssince- the change predicate- Returns:
trueif one artifact changed,falseelse
-
createArtifact
Creates an artifact instance.- Parameters:
artifact- the textual artifact specificationscope- the resolution scope- Returns:
- the artifact or null if none can be created
-
clear
public void clear()Clears the resolver for reuse.
-