Class MavenArtifactHelper
- java.lang.Object
-
- io.wcm.devops.conga.tooling.maven.plugin.util.MavenArtifactHelper
-
public class MavenArtifactHelper extends Object
Helper for resolving maven artifacts.
-
-
Constructor Summary
Constructors Constructor Description MavenArtifactHelper(Environment environment, PluginContextOptions pluginContextOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.eclipse.aether.artifact.Artifact>
dependencyUrlsToArtifactsWithTransitiveDependencies(Collection<String> dependencyUrls)
Transform a list of dependency urls to a list of references maven artifacts including their transitive dependencies.List<org.eclipse.aether.artifact.Artifact>
getTransitiveDependencies(org.eclipse.aether.artifact.Artifact artifact)
Get transitive compile dependencies of given artifact.org.eclipse.aether.artifact.Artifact
resolveArtifact(String artifactCoords)
Get Maven artifact for given artifact coordinates.org.eclipse.aether.artifact.Artifact
resolveArtifact(String groupId, String artifactId, String type, String classifier, String version)
Get Maven artifact for given artifact coordinates.
-
-
-
Constructor Detail
-
MavenArtifactHelper
public MavenArtifactHelper(Environment environment, PluginContextOptions pluginContextOptions)
- Parameters:
environment
- CONGA environmentpluginContextOptions
- 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 IdartifactId
- Artifact Idtype
- Typeclassifier
- Classifierversion
- 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
-
-