public class MavenResolver extends Object
| Constructor and Description |
|---|
MavenResolver(List<String> profiles,
ArtifactResolver artifactResolver,
RepositoryResolver repositoryResolver) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloverJAR(List<org.eclipse.aether.artifact.Artifact> artifacts) |
org.eclipse.aether.artifact.Artifact |
convertToArtifact(org.apache.maven.model.Dependency dependency) |
List<org.eclipse.aether.artifact.Artifact> |
convertToArtifacts(Collection<ArtifactCoordinate> artifactCoordinates,
boolean resolveExtraJARs) |
List<org.eclipse.aether.artifact.Artifact> |
convertToArtifacts(Collection<org.apache.maven.model.Dependency> dependencies) |
Collection<org.eclipse.aether.artifact.Artifact> |
getDependencies(org.apache.maven.model.Model model) |
org.apache.maven.model.Model |
getModelFromCurrentPOM() |
org.apache.maven.model.Model |
getModelFromPOM(File pomFile) |
org.apache.maven.model.Model |
getModelFromPOMArtifact(org.eclipse.aether.artifact.Artifact artifact) |
String |
getPlatformVersion() |
String |
getPropertyFromCurrentPOM(String propertyName) |
public MavenResolver(List<String> profiles, ArtifactResolver artifactResolver, RepositoryResolver repositoryResolver)
profiles - the list of Maven profile to enable when reading/resolving pom filesartifactResolver - the resolver to resolve artifacts from Maven repositoriesrepositoryResolver - the resolver to create Maven repositories and sessionspublic org.apache.maven.model.Model getModelFromCurrentPOM()
throws Exception
pom.xml file in the current directory (i.e. the POM of the module
executing functional tests)Exception - if an error occurred during reading and parsing of the POMpublic String getPlatformVersion() throws Exception
Exception - if an error occurred during reading and parsing of the POMpublic String getPropertyFromCurrentPOM(String propertyName) throws Exception
propertyName - the maven property name for which to retrieve the valueException - if the property doesn't existpublic org.apache.maven.model.Model getModelFromPOM(File pomFile) throws Exception
pomFile - the location of the pom file to readpom.xml file passed in parametersException - if an error occurred during reading and parsing of the POMpublic org.apache.maven.model.Model getModelFromPOMArtifact(org.eclipse.aether.artifact.Artifact artifact)
throws Exception
artifact - the artifact for which to read and parse the POMException - if an error occurred during resolving of the artifact or during reading and parsing of the POMpublic org.eclipse.aether.artifact.Artifact convertToArtifact(org.apache.maven.model.Dependency dependency)
dependency - the dependency to convert to an Artifact instancepublic List<org.eclipse.aether.artifact.Artifact> convertToArtifacts(Collection<org.apache.maven.model.Dependency> dependencies)
dependencies - the dependencies to convert to Artifact instancespublic List<org.eclipse.aether.artifact.Artifact> convertToArtifacts(Collection<ArtifactCoordinate> artifactCoordinates, boolean resolveExtraJARs) throws Exception
artifactCoordinates - the Maven artifact coordinates to convert to a resolved list of ArtifactsresolveExtraJARs - whether or not extra JARs without version should get their version resolved from the
current POM or notException - in case the POM model cannot be resolvedpublic void addCloverJAR(List<org.eclipse.aether.artifact.Artifact> artifacts) throws Exception
artifacts - the list of artifacts to which to add the Clover JARException - in case the POM model cannot be resolvedpublic Collection<org.eclipse.aether.artifact.Artifact> getDependencies(org.apache.maven.model.Model model) throws Exception
model - the model from which to find the current artifact and its transitive dependenciesException - in case an error occurred during resolvingCopyright © 2004–2021 XWiki. All rights reserved.