public final class RepositoryUtility extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.eclipse.aether.repository.RemoteRepository |
CENTRAL |
| Modifier and Type | Method and Description |
|---|---|
static String |
findLatestCoordinates(org.eclipse.aether.RepositorySystem repositorySystem,
String groupId,
String artifactId)
Returns the latest Maven coordinates for
groupId:artifactId in repositorySystem. |
static com.google.common.collect.ImmutableList<String> |
findVersions(org.eclipse.aether.RepositorySystem repositorySystem,
String groupId,
String artifactId)
Returns list of versions available for
groupId:artifactId in repositorySystem. |
static org.eclipse.aether.repository.RemoteRepository |
mavenRepositoryFromUrl(String mavenRepositoryUrl)
Returns Maven repository specified as
mavenRepositoryUrl, after validating the syntax
of the URL. |
static org.eclipse.aether.RepositorySystem |
newRepositorySystem()
Creates a new system configured for file and HTTP repository resolution.
|
static org.eclipse.aether.RepositorySystemSession |
newSession(org.eclipse.aether.RepositorySystem system)
Opens a new Maven repository session that looks for the local repository in the
customary ~/.m2 directory.
|
static Bom |
readBom(Path pomFile) |
static Bom |
readBom(String coordinates)
Parse the dependencyManagement section of an artifact and return the artifacts included there.
|
static Bom |
readBom(String coordinates,
List<String> mavenRepositoryUrls)
Parse the dependencyManagement section of an artifact and return the artifacts included there.
|
static boolean |
shouldSkipBomMember(org.eclipse.aether.artifact.Artifact artifact)
Returns true if the
artifact in BOM should be skipped for checks. |
public static org.eclipse.aether.RepositorySystem newRepositorySystem()
public static org.eclipse.aether.RepositorySystemSession newSession(org.eclipse.aether.RepositorySystem system)
public static Bom readBom(Path pomFile) throws MavenRepositoryException
MavenRepositoryExceptionpublic static Bom readBom(String coordinates) throws org.eclipse.aether.resolution.ArtifactDescriptorException
org.eclipse.aether.resolution.ArtifactDescriptorExceptionpublic static Bom readBom(String coordinates, List<String> mavenRepositoryUrls) throws org.eclipse.aether.resolution.ArtifactDescriptorException
mavenRepositoryUrls - URLs of Maven repositories when resolving the BOM coordinatesorg.eclipse.aether.resolution.ArtifactDescriptorExceptionpublic static boolean shouldSkipBomMember(org.eclipse.aether.artifact.Artifact artifact)
artifact in BOM should be skipped for checks.public static org.eclipse.aether.repository.RemoteRepository mavenRepositoryFromUrl(String mavenRepositoryUrl)
mavenRepositoryUrl, after validating the syntax
of the URL.IllegalArgumentException - if the URL is malformed for a Maven repositorypublic static com.google.common.collect.ImmutableList<String> findVersions(org.eclipse.aether.RepositorySystem repositorySystem, String groupId, String artifactId) throws MavenRepositoryException
groupId:artifactId in repositorySystem.
The returned list is in ascending order with regard to GenericVersionScheme; the highest version comes at last.MavenRepositoryExceptionpublic static String findLatestCoordinates(org.eclipse.aether.RepositorySystem repositorySystem, String groupId, String artifactId) throws MavenRepositoryException
groupId:artifactId in repositorySystem.MavenRepositoryExceptionCopyright © 2018–2020 Google LLC.. All rights reserved.