Class FeatureSetsDependenciesMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="featuresets-dependencies",
          requiresProject=true,
          requiresDependencyResolution=COMPILE,
          defaultPhase=PROCESS_RESOURCES)
    public final class FeatureSetsDependenciesMojo
    extends org.apache.maven.plugin.AbstractMojo
    Resolves and unpack corresponding sources of project dependencies.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
      Manager used to look up Archiver/UnArchiver implementations.
      private java.lang.String copyExcludes
      Comma separated list of (g:)a(:v) to excludes for unpack.
      private java.lang.String copyTypes
      Comma separated list of file extensions to include for copy.
      private java.lang.String excludes
      Comma separated list of exclude patterns.
      private java.lang.String excludeScope
      Scope to exclude.
      private java.lang.String featureSetGroupIdIncludes
      The groupId of the feature sets to include.
      private java.lang.String includes
      Comma separated list of include patterns.
      private java.lang.String includeScope
      Scope to include.
      private java.util.List<FeatureSetsDependenciesMojo.DependencyMapping> mappings
      Custom mappings.
      private org.apache.maven.project.MavenProject project
      The maven project.
      private static java.lang.String PROPERTY_PREFIX
      Parameters property prefix.
      private java.util.List<org.eclipse.aether.repository.RemoteRepository> remoteRepos
      The project remote repositories to use.
      private org.eclipse.aether.RepositorySystemSession repoSession
      The current repository/network configuration of Maven.
      private org.eclipse.aether.RepositorySystem repoSystem
      The entry point to Aether.
      private boolean skip
      Skip this mojo.
      private java.io.File stageDirectory
      The directory where the files will be copied.
      private java.lang.String unpackExcludes
      Comma separated list of (g:)a(:v) to excludes for unpack.
      private java.lang.String unpackTypes
      Comma separated list of file extensions to include for unpack.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      private java.lang.String getMapping​(org.eclipse.aether.artifact.Artifact artifact)
      Get the mapping for a given artifact.
      private static boolean isArtifactExcluded​(java.util.List<java.lang.String> excludes, org.eclipse.aether.artifact.Artifact artifact)
      Match the given artifact against the exclusion list.
      private boolean isScopeIncluded​(java.lang.String scope)
      Match the given scope with the includeScope and excludeScope parameters.
      private static java.util.List<java.lang.String> stringAsList​(java.lang.String str, java.lang.String c)
      Convert a String to a List.
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PROPERTY_PREFIX

        private static final java.lang.String PROPERTY_PREFIX
        Parameters property prefix.
        See Also:
        Constant Field Values
      • repoSystem

        @Component
        private org.eclipse.aether.RepositorySystem repoSystem
        The entry point to Aether.
      • repoSession

        @Parameter(defaultValue="${repositorySystemSession}",
                   readonly=true)
        private org.eclipse.aether.RepositorySystemSession repoSession
        The current repository/network configuration of Maven.
      • remoteRepos

        @Parameter(defaultValue="${project.remoteProjectRepositories}",
                   readonly=true)
        private java.util.List<org.eclipse.aether.repository.RemoteRepository> remoteRepos
        The project remote repositories to use.
      • archiverManager

        @Component
        private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
        Manager used to look up Archiver/UnArchiver implementations.
      • project

        @Parameter(defaultValue="${project}",
                   required=true,
                   readonly=true)
        private org.apache.maven.project.MavenProject project
        The maven project.
      • stageDirectory

        @Parameter(property="gfbuild.featuresets.dependencies.stageDirectory",
                   defaultValue="${project.build.directory}/stage")
        private java.io.File stageDirectory
        The directory where the files will be copied.
      • copyTypes

        @Parameter(property="gfbuild.featuresets.dependencies.copyTypes",
                   defaultValue="jar,war,rar")
        private java.lang.String copyTypes
        Comma separated list of file extensions to include for copy.
      • copyExcludes

        @Parameter(property="gfbuild.featuresets.dependencies.copyExcludes",
                   defaultValue="")
        private java.lang.String copyExcludes
        Comma separated list of (g:)a(:v) to excludes for unpack.
      • unpackTypes

        @Parameter(property="gfbuild.featuresets.dependencies.unpackTypes",
                   defaultValue="zip")
        private java.lang.String unpackTypes
        Comma separated list of file extensions to include for unpack.
      • unpackExcludes

        @Parameter(property="gfbuild.featuresets.dependencies.unpackExcludes",
                   defaultValue="")
        private java.lang.String unpackExcludes
        Comma separated list of (g:)a(:v) to excludes for unpack.
      • includes

        @Parameter(property="gfbuild.featuresets.dependencies.includes",
                   defaultValue="")
        private java.lang.String includes
        Comma separated list of include patterns.
      • excludes

        @Parameter(property="gfbuild.featuresets.dependencies.excludes",
                   defaultValue="")
        private java.lang.String excludes
        Comma separated list of exclude patterns.
      • includeScope

        @Parameter(property="gfbuild.featuresets.dependencies.includeScope",
                   defaultValue="compile",
                   required=false)
        private java.lang.String includeScope
        Scope to include. An Empty string indicates all scopes.
      • excludeScope

        @Parameter(property="gfbuild.featuresets.dependencies.excludeScope",
                   defaultValue="test,system")
        private java.lang.String excludeScope
        Scope to exclude. An Empty string indicates no scopes.
      • featureSetGroupIdIncludes

        @Parameter(property="gfbuild.featuresets.dependencies.featureset.groupid.includes",
                   defaultValue="")
        private java.lang.String featureSetGroupIdIncludes
        The groupId of the feature sets to include.
      • skip

        @Parameter(property="gfbuild.featuresets.dependencies.skip",
                   defaultValue="false")
        private boolean skip
        Skip this mojo.
    • Constructor Detail

      • FeatureSetsDependenciesMojo

        public FeatureSetsDependenciesMojo()
    • Method Detail

      • getMapping

        private java.lang.String getMapping​(org.eclipse.aether.artifact.Artifact artifact)
        Get the mapping for a given artifact. Lookup the configured mapping for a custom mapping, otherwise return the artifactId
        Parameters:
        artifact - the artifact to be mapped
        Returns:
        the mapped name for the artifact
      • stringAsList

        private static java.util.List<java.lang.String> stringAsList​(java.lang.String str,
                                                                     java.lang.String c)
        Convert a String to a List.
        Parameters:
        str - the String to convert
        c - the character used as separated in the String
        Returns:
        the converted List
      • isScopeIncluded

        private boolean isScopeIncluded​(java.lang.String scope)
        Match the given scope with the includeScope and excludeScope parameters.
        Parameters:
        scope - the scope to match
        Returns:
        true if the scope is included and not excluded, false otherwise
      • isArtifactExcluded

        private static boolean isArtifactExcluded​(java.util.List<java.lang.String> excludes,
                                                  org.eclipse.aether.artifact.Artifact artifact)
        Match the given artifact against the exclusion list.
        Parameters:
        excludes - the exclusion list
        artifact - the artifact to match
        Returns:
        true if the artifact is included, false otherwise
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException