Class Dependency31Helper

  • All Implemented Interfaces:
    DependencyHelper

    public class Dependency31Helper
    extends Object
    implements DependencyHelper

    DependencyHelper for accessing Eclipse Aether system used in Maven 3.1+. It uses reflection to access these methods of maven-core APIs which directly references Eclipse Aether classes.

    • Field Detail

      • localDependencies

        protected Map<org.eclipse.aether.artifact.Artifact,​LocalDependency> localDependencies
      • treeListing

        protected String treeListing
    • Constructor Detail

      • Dependency31Helper

        public Dependency31Helper​(List<?> repositories,
                                  Object session,
                                  org.eclipse.aether.RepositorySystem repositorySystem,
                                  int cacheSize)
      • Dependency31Helper

        public Dependency31Helper​(List<?> repositories,
                                  Object session,
                                  org.eclipse.aether.RepositorySystem repositorySystem)
    • Method Detail

      • setRepositorySession

        public void setRepositorySession​(org.apache.maven.project.ProjectBuildingRequest request)
                                  throws org.apache.maven.plugin.MojoExecutionException
        Specified by:
        setRepositorySession in interface DependencyHelper
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getDependencies

        public void getDependencies​(org.apache.maven.project.MavenProject project,
                                    boolean useTransitiveDependencies)
                             throws org.apache.maven.plugin.MojoExecutionException
        Specified by:
        getDependencies in interface DependencyHelper
        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)
      • resolveById

        public File resolveById​(String id,
                                org.apache.maven.plugin.logging.Log log)
                         throws org.apache.maven.plugin.MojoFailureException
        Specified by:
        resolveById in interface DependencyHelper
        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: DependencyHelper
        Convert a Maven Artifact into a PAX URL mvn format.
        Specified by:
        artifactToMvn in interface DependencyHelper
        Parameters:
        artifact - The Maven Artifact.
        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: DependencyHelper
        Convert an Aether (Sonatype or Eclipse) artifact into a PAX URL mvn format.
        Specified by:
        artifactToMvn in interface DependencyHelper
        Parameters:
        _artifact - The Aether org.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:
        mvnToArtifact in interface DependencyHelper
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • pathFromMaven

        public String pathFromMaven​(String name)
                             throws org.apache.maven.plugin.MojoExecutionException
        Description copied from interface: DependencyHelper
        Convert a PAX URL mvn format into a filesystem path.
        Specified by:
        pathFromMaven in interface DependencyHelper
        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: DependencyHelper
        Convert an Aether coordinate format into a filesystem path.
        Specified by:
        pathFromAether in interface DependencyHelper
        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.