Class 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 Detail

      • descriptors

        @Parameter
        protected List<String> descriptors
      • descriptorArtifacts

        protected Set<org.apache.maven.artifact.Artifact> descriptorArtifacts
      • features

        @Parameter
        protected List<String> features
      • 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
    • Constructor Detail

      • AbstractFeatureMojo

        public AbstractFeatureMojo()
    • 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 - The List of 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
        Parameters:
        featureNames - The List of feature names.
        features - The Set of features.
        featuresMap - The Map of features.
        transitive - True to add transitive features, false else.
      • 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.