Class MavenArtifactHelper


  • public class MavenArtifactHelper
    extends Object
    Helper for resolving maven artifacts.
    • Constructor Detail

      • MavenArtifactHelper

        public MavenArtifactHelper​(Environment environment,
                                   PluginContextOptions pluginContextOptions)
        Parameters:
        environment - CONGA environment
        pluginContextOptions - Plugin context options
    • Method Detail

      • resolveArtifact

        public org.eclipse.aether.artifact.Artifact resolveArtifact​(String artifactCoords)
                                                             throws IOException
        Get Maven artifact for given artifact coordinates.
        Parameters:
        artifactCoords - Artifact coordinates in either Maven-style or Pax URL-style.
        Returns:
        Maven artifact
        Throws:
        IOException - If artifact resolution was not successful
      • resolveArtifact

        public org.eclipse.aether.artifact.Artifact resolveArtifact​(String groupId,
                                                                    String artifactId,
                                                                    String type,
                                                                    String classifier,
                                                                    String version)
                                                             throws IOException
        Get Maven artifact for given artifact coordinates.
        Parameters:
        groupId - Group Id
        artifactId - Artifact Id
        type - Type
        classifier - Classifier
        version - Version
        Returns:
        Artifact
        Throws:
        IOException - If dependency resolution fails
      • getTransitiveDependencies

        public List<org.eclipse.aether.artifact.Artifact> getTransitiveDependencies​(org.eclipse.aether.artifact.Artifact artifact)
                                                                             throws IOException
        Get transitive compile dependencies of given artifact.
        Parameters:
        artifact - Maven artifact
        Returns:
        List of artifact dependencies
        Throws:
        IOException - If artifact resolution was not successful
      • dependencyUrlsToArtifactsWithTransitiveDependencies

        public List<org.eclipse.aether.artifact.Artifact> dependencyUrlsToArtifactsWithTransitiveDependencies​(Collection<String> dependencyUrls)
                                                                                                       throws IOException
        Transform a list of dependency urls to a list of references maven artifacts including their transitive dependencies.
        Parameters:
        dependencyUrls - Dependency URLs
        Returns:
        List of artifacts
        Throws:
        IOException - If dependency resolution fails