Class PluginUtils
java.lang.Object
org.apache.maven.tools.plugin.util.PluginUtils
Convenience methods to play with Maven plugins.
- Author:
- jdcasey
-
Field Summary
Modifier and TypeFieldDescriptionDeprecated.wrong approach (fake components), documented parameter default values instead to learn people how to discover them -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
findSources
(String basedir, String include) static String[]
findSources
(String basedir, String include, String exclude) static boolean
isMavenReport
(String mojoClassName, org.apache.maven.project.MavenProject project) static void
sortMojoParameters
(List<org.apache.maven.plugin.descriptor.Parameter> parameters) Sorts the specified mojo parameters by name.static void
Sorts the specified mojo descriptors by goal name.
-
Field Details
-
MAVEN_COMPONENTS
Deprecated.wrong approach (fake components), documented parameter default values instead to learn people how to discover themExpression 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 Details
-
findSources
- Parameters:
basedir
- not nullinclude
- not null- Returns:
- list of included files with default SCM excluded files
-
findSources
- Parameters:
basedir
- not nullinclude
- not nullexclude
- 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 benull
.- 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 benull
.- Since:
- 2.4.4
- See Also:
-
Parameter.getName()
-
isMavenReport
public static boolean isMavenReport(String mojoClassName, org.apache.maven.project.MavenProject project) throws IllegalArgumentException - Parameters:
mojoClassName
- a fully qualified Mojo implementation class name, not nullproject
- a MavenProject instance, could be null- Returns:
true
if the Mojo class implementsMavenReport
,false
otherwise.- Throws:
IllegalArgumentException
- if any- Since:
- 3.10.0
-