Package org.apache.karaf.tooling.utils
Class Dependency31Helper
- java.lang.Object
-
- org.apache.karaf.tooling.utils.Dependency31Helper
-
- All Implemented Interfaces:
DependencyHelper
public class Dependency31Helper extends Object implements DependencyHelper
DependencyHelperfor accessing Eclipse Aether system used in Maven 3.1+. It uses reflection to access these methods ofmaven-coreAPIs which directly references Eclipse Aether classes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDependency31Helper.ScopeDependencySelector2
-
Field Summary
Fields Modifier and Type Field Description protected Map<org.eclipse.aether.artifact.Artifact,LocalDependency>localDependenciesprotected StringtreeListing
-
Constructor Summary
Constructors Constructor Description Dependency31Helper(List<?> repositories, Object session, org.eclipse.aether.RepositorySystem repositorySystem)Dependency31Helper(List<?> repositories, Object session, org.eclipse.aether.RepositorySystem repositorySystem, int cacheSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringartifactToMvn(Object _artifact, String versionOrRange)Convert an Aether (Sonatype or Eclipse) artifact into a PAX URL mvn format.StringartifactToMvn(org.apache.maven.artifact.Artifact artifact, String versionOrRange)Convert a MavenArtifactinto a PAX URL mvn format.StringgetArtifactId(Object artifact)StringgetBaseVersion(Object artifact)StringgetClassifier(Object artifact)voidgetDependencies(org.apache.maven.project.MavenProject project, boolean useTransitiveDependencies)StringgetGroupId(Object artifact)Collection<LocalDependency>getLocalDependencies()StringgetTreeListing()booleanisArtifactAFeature(Object artifact)static booleanisFeature(org.eclipse.aether.artifact.Artifact artifact)static booleanisFeature(org.eclipse.aether.graph.DependencyNode dependencyNode)org.apache.maven.artifact.ArtifactmvnToArtifact(String name)StringpathFromAether(String name)Convert an Aether coordinate format into a filesystem path.StringpathFromMaven(String name)Convert a PAX URL mvn format into a filesystem path.Fileresolve(Object artifact, org.apache.maven.plugin.logging.Log log)FileresolveById(String id, org.apache.maven.plugin.logging.Log log)voidsetRepositorySession(org.apache.maven.project.ProjectBuildingRequest request)
-
-
-
Field Detail
-
localDependencies
protected Map<org.eclipse.aether.artifact.Artifact,LocalDependency> localDependencies
-
treeListing
protected String treeListing
-
-
Method Detail
-
setRepositorySession
public void setRepositorySession(org.apache.maven.project.ProjectBuildingRequest request) throws org.apache.maven.plugin.MojoExecutionException- Specified by:
setRepositorySessionin interfaceDependencyHelper- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getLocalDependencies
public Collection<LocalDependency> getLocalDependencies()
- Specified by:
getLocalDependenciesin interfaceDependencyHelper
-
getTreeListing
public String getTreeListing()
- Specified by:
getTreeListingin interfaceDependencyHelper
-
getDependencies
public void getDependencies(org.apache.maven.project.MavenProject project, boolean useTransitiveDependencies) throws org.apache.maven.plugin.MojoExecutionException- Specified by:
getDependenciesin interfaceDependencyHelper- Throws:
org.apache.maven.plugin.MojoExecutionException
-
isFeature
public static boolean isFeature(org.eclipse.aether.graph.DependencyNode dependencyNode)
-
isFeature
public static boolean isFeature(org.eclipse.aether.artifact.Artifact artifact)
-
isArtifactAFeature
public boolean isArtifactAFeature(Object artifact)
- Specified by:
isArtifactAFeaturein interfaceDependencyHelper
-
getBaseVersion
public String getBaseVersion(Object artifact)
- Specified by:
getBaseVersionin interfaceDependencyHelper
-
getGroupId
public String getGroupId(Object artifact)
- Specified by:
getGroupIdin interfaceDependencyHelper
-
getArtifactId
public String getArtifactId(Object artifact)
- Specified by:
getArtifactIdin interfaceDependencyHelper
-
getClassifier
public String getClassifier(Object artifact)
- Specified by:
getClassifierin interfaceDependencyHelper
-
resolve
public File resolve(Object artifact, org.apache.maven.plugin.logging.Log log)
- Specified by:
resolvein interfaceDependencyHelper
-
resolveById
public File resolveById(String id, org.apache.maven.plugin.logging.Log log) throws org.apache.maven.plugin.MojoFailureException
- Specified by:
resolveByIdin interfaceDependencyHelper- Throws:
org.apache.maven.plugin.MojoFailureException
-
artifactToMvn
public String artifactToMvn(org.apache.maven.artifact.Artifact artifact, String versionOrRange) throws org.apache.maven.plugin.MojoExecutionException
Description copied from interface:DependencyHelperConvert a MavenArtifactinto a PAX URL mvn format.- Specified by:
artifactToMvnin interfaceDependencyHelper- Parameters:
artifact- The MavenArtifact.- Returns:
- The corresponding PAX URL mvn format (mvn:groupId/artifactId/version/type/classifier)
- Throws:
org.apache.maven.plugin.MojoExecutionException- If the plugin execution fails.
-
artifactToMvn
public String artifactToMvn(Object _artifact, String versionOrRange)
Description copied from interface:DependencyHelperConvert an Aether (Sonatype or Eclipse) artifact into a PAX URL mvn format.- Specified by:
artifactToMvnin interfaceDependencyHelper- Parameters:
_artifact- The Aetherorg.sonatype|eclipse.aether.artifact.Artifact.- Returns:
- The corresponding PAX URL mvn format (mvn:groupId/artifactId/version/type/classifier).
-
mvnToArtifact
public org.apache.maven.artifact.Artifact mvnToArtifact(String name) throws org.apache.maven.plugin.MojoExecutionException
- Specified by:
mvnToArtifactin interfaceDependencyHelper- Throws:
org.apache.maven.plugin.MojoExecutionException
-
pathFromMaven
public String pathFromMaven(String name) throws org.apache.maven.plugin.MojoExecutionException
Description copied from interface:DependencyHelperConvert a PAX URL mvn format into a filesystem path.- Specified by:
pathFromMavenin interfaceDependencyHelper- Parameters:
name- PAX URL mvn format (mvn:groupId/artifactId/version/type/classifier).- Returns:
- The filesystem path.
- Throws:
org.apache.maven.plugin.MojoExecutionException- If the plugin execution fails.
-
pathFromAether
public String pathFromAether(String name) throws org.apache.maven.plugin.MojoExecutionException
Description copied from interface:DependencyHelperConvert an Aether coordinate format into a filesystem path.- Specified by:
pathFromAetherin interfaceDependencyHelper- Parameters:
name- The Aether coordinate format (groupId:artifactId[:extension[:classifier]]:version).- Returns:
- The filesystem path.
- Throws:
org.apache.maven.plugin.MojoExecutionException- If the plugin execution fails.
-
-