Class AbstractFeatureMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.karaf.tooling.utils.MojoSupport
-
- org.apache.karaf.tooling.features.AbstractFeatureMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AddToRepositoryMojo,ExportFeatureMetaDataMojo
public abstract class AbstractFeatureMojo extends MojoSupport
Common functionality for mojos that need to resolve features
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanaddTransitiveFeaturesprotected Set<org.apache.maven.artifact.Artifact>descriptorArtifactsprotected List<String>descriptorsprotected List<String>featuresprotected booleanignoreDependencyFlagIgnore the dependency flag on the bundles in the features XMLprotected booleanskipNonMavenProtocols-
Fields inherited from class org.apache.karaf.tooling.utils.MojoSupport
artifactMetadataSource, artifactResolver, container, factory, localRepo, mavenSession, project, projectBuilder, projectHelper, remoteRepos, workDirectory
-
-
Constructor Summary
Constructors Constructor Description AbstractFeatureMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFeatureRepo(String featureUrl)protected voidaddFeatures(List<String> featureNames, Set<org.apache.karaf.features.internal.model.Feature> features, Map<String,org.apache.karaf.features.internal.model.Feature> featuresMap, boolean transitive)Populate the features by traversing the listed features and their dependencies if transitive is trueprotected voidaddFeaturesDependencies(List<org.apache.karaf.features.internal.model.Dependency> featureNames, Set<org.apache.karaf.features.internal.model.Feature> features, Map<String,org.apache.karaf.features.internal.model.Feature> featuresMap, boolean transitive)protected voidcheckDoGarbageCollect()Maven ArtifactResolver leaves file handles around so need to clean up or we will run out of file descriptors.protected voidresolveArtifact(org.apache.maven.artifact.Artifact artifact, List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)Resolves and copies the given artifact to the repository path.protected Set<org.apache.karaf.features.internal.model.Feature>resolveFeatures()protected voidretrieveDescriptorsRecursively(String uri, Set<String> bundles, Map<String,org.apache.karaf.features.internal.model.Feature> featuresMap)-
Methods inherited from class org.apache.karaf.tooling.utils.MojoSupport
copy, createManagedVersionMap, getLocalRepoUrl, getProject, getProjectHelper, getWorkDirectory, resourceToArtifact, setMavenSession, translateFromMaven
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
descriptorArtifacts
protected Set<org.apache.maven.artifact.Artifact> descriptorArtifacts
-
addTransitiveFeatures
@Parameter protected boolean addTransitiveFeatures
-
skipNonMavenProtocols
@Parameter protected boolean skipNonMavenProtocols
-
ignoreDependencyFlag
@Parameter(defaultValue="false") protected boolean ignoreDependencyFlag
Ignore the dependency flag on the bundles in the features XML
-
-
Method Detail
-
addFeatureRepo
protected void addFeatureRepo(String featureUrl) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
retrieveDescriptorsRecursively
protected void retrieveDescriptorsRecursively(String uri, Set<String> bundles, Map<String,org.apache.karaf.features.internal.model.Feature> featuresMap)
-
resolveArtifact
protected void resolveArtifact(org.apache.maven.artifact.Artifact artifact, List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)Resolves and copies the given artifact to the repository path. Prefers to resolve using the repository of the artifact if present.- Parameters:
artifact- The artifact.remoteRepos- TheListof remote repositories to use for artifact resolution.
-
addFeatures
protected void addFeatures(List<String> featureNames, Set<org.apache.karaf.features.internal.model.Feature> features, Map<String,org.apache.karaf.features.internal.model.Feature> featuresMap, boolean transitive)
Populate the features by traversing the listed features and their dependencies if transitive is true
-
addFeaturesDependencies
protected void addFeaturesDependencies(List<org.apache.karaf.features.internal.model.Dependency> featureNames, Set<org.apache.karaf.features.internal.model.Feature> features, Map<String,org.apache.karaf.features.internal.model.Feature> featuresMap, boolean transitive)
-
resolveFeatures
protected Set<org.apache.karaf.features.internal.model.Feature> resolveFeatures() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
checkDoGarbageCollect
protected void checkDoGarbageCollect()
Maven ArtifactResolver leaves file handles around so need to clean up or we will run out of file descriptors.
-
-