public class MavenResolver extends Object
Constructor and Description |
---|
MavenResolver(List<String> profiles,
ArtifactResolver artifactResolver,
RepositoryResolver repositoryResolver) |
Modifier and Type | Method and Description |
---|---|
org.eclipse.aether.artifact.Artifact |
convertToArtifact(org.apache.maven.model.Dependency dependency) |
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 instanceCopyright © 2004–2019 XWiki. All rights reserved.