Class PluginUtils


  • public final class PluginUtils
    extends Object
    Convenience methods to play with Maven plugins.
    Author:
    jdcasey
    • Field Detail

      • MAVEN_COMPONENTS

        public static final Map<String,​String> MAVEN_COMPONENTS
        Deprecated.
        wrong approach (fake components), documented parameter default values instead to learn people how to discover them
        Expression associated with class types to recognize Maven objects (injected in fact as parameters by maven-core's PluginParameterExpressionEvaluator) like components ("real" components are injected by Plexus).
    • Method Detail

      • findSources

        public static String[] findSources​(String basedir,
                                           String include)
        Parameters:
        basedir - not null
        include - not null
        Returns:
        list of included files with default SCM excluded files
      • findSources

        public static String[] findSources​(String basedir,
                                           String include,
                                           String exclude)
        Parameters:
        basedir - not null
        include - not null
        exclude - could be null
        Returns:
        list of included files
      • sortMojos

        public static void sortMojos​(List<org.apache.maven.plugin.descriptor.MojoDescriptor> mojoDescriptors)
        Sorts the specified mojo descriptors by goal name.
        Parameters:
        mojoDescriptors - The mojo descriptors to sort, may be null.
        See Also:
        MojoDescriptor.getGoal()
      • sortMojoParameters

        public static void sortMojoParameters​(List<org.apache.maven.plugin.descriptor.Parameter> parameters)
        Sorts the specified mojo parameters by name.
        Parameters:
        parameters - The mojo parameters to sort, may be null.
        Since:
        2.4.4
        See Also:
        Parameter.getName()