public class ArtifactVersionCollector extends Object
| Constructor and Description |
|---|
ArtifactVersionCollector()
Default constructor using default artifact comparator.
|
ArtifactVersionCollector(Comparator<Artifact> sortingComparator)
Create a new collector using a custom sorting comparator.
|
| Modifier and Type | Method and Description |
|---|---|
Set<Artifact> |
artifactsByGroupId(String groupId,
boolean exact)
Find a set of artifacts by groupId or groupId prefix.
|
Set<Artifact> |
collect()
Collect all artifact coordinates and their versions using service loader.
|
static Set<Artifact> |
collectArtifacts()
Collect all artifact coordinates and their versions using service loader.
|
static Artifact |
findArtifact(String groupId,
String artifactId)
Find a given artifact by its coordinates (just without the version).
|
static Set<Artifact> |
findArtifactsByGroupId(String groupId,
boolean exact)
Find a set of artifacts by groupId or groupId prefix.
|
static Artifact |
iterateArtifacts(ArtifactConsumer consumer)
Iterate list of artifacts and check them using a given lambda.
|
public ArtifactVersionCollector()
public ArtifactVersionCollector(Comparator<Artifact> sortingComparator)
sortingComparator - the comparator to determine the order of artifactspublic static Set<Artifact> collectArtifacts()
public Set<Artifact> collect()
public static Artifact findArtifact(String groupId, String artifactId)
groupId - the group idartifactId - the artifact idnull in case it is not foundpublic static Set<Artifact> findArtifactsByGroupId(String groupId, boolean exact)
groupId - the groupId or groupId prefixexact - true to check for exact groupId, false to use groupId as a prefixpublic Set<Artifact> artifactsByGroupId(String groupId, boolean exact)
groupId - the groupId or groupId prefixexact - true to check for exact groupId, false to use groupId as a prefixpublic static Artifact iterateArtifacts(ArtifactConsumer consumer)
findArtifact(String, String) and
artifactsByGroupId(String, boolean) for examples.consumer - the artifact consumer (see ArtifactConsumer for detailsnullCopyright © 2021. All rights reserved.