Class GeneratorUtils
java.lang.Object
org.apache.maven.tools.plugin.generator.GeneratorUtils
Convenience methods to play with Maven plugins.
- Author:
- jdcasey
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringdiscoverPackageName(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor) Find the best package name, based on the number of hits of actual Mojo classes.static voidstatic booleanisMavenReport(String impl, org.apache.maven.project.MavenProject project) Deprecated.static StringmakeHtmlValid(String description) Deprecated.Redundant for java extractorstatic List<org.codehaus.plexus.component.repository.ComponentDependency> toComponentDependencies(Collection<org.apache.maven.artifact.Artifact> artifacts) static StringDeprecated.Replaced byHtmlToPlainTextConverterstatic voidwriteDependencies(org.codehaus.plexus.util.xml.XMLWriter w, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor) 
- 
Method Details- 
writeDependenciespublic static void writeDependencies(org.codehaus.plexus.util.xml.XMLWriter w, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor) - Parameters:
- w- not null writer
- pluginDescriptor- not null
 
- 
element- Parameters:
- w- not null writer
- name- not null
- value- could be null
 
- 
toComponentDependenciespublic static List<org.codehaus.plexus.component.repository.ComponentDependency> toComponentDependencies(Collection<org.apache.maven.artifact.Artifact> artifacts) - Parameters:
- artifacts- not null collection of- Artifact
- Returns:
- list of component dependencies, without in provided scope
 
- 
makeHtmlValidDeprecated.Redundant for java extractorFixes some javadoc comment to become a valid XHTML snippet.- Parameters:
- description- Javadoc description with HTML tags, may be- null.
- Returns:
- The description with valid XHTML tags, never null.
 
- 
toTextDeprecated.Replaced byHtmlToPlainTextConverterConverts a HTML fragment as extracted from a javadoc comment to a plain text string. This method tries to retain as much of the text formatting as possible by means of the following transformations:- List items are converted to leading tabs (U+0009), followed by the item number/bullet, another tab and finally the item contents. Each tab denotes an increase of indentation.
- Flow breaking elements as well as literal line terminators in preformatted text are converted to a newline (U+000A) to denote a mandatory line break.
- Consecutive spaces and line terminators from character data outside of preformatted text will be normalized to a single space. The resulting space denotes a possible point for line wrapping.
- Each space in preformatted text will be converted to a non-breaking space (U+00A0).
 - Parameters:
- html- The HTML fragment to convert to plain text, may be- null.
- Returns:
- A string with HTML tags converted into pure text, never null.
- Since:
- 2.4.3
 
- 
discoverPackageNamepublic static String discoverPackageName(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor) Find the best package name, based on the number of hits of actual Mojo classes.- Parameters:
- pluginDescriptor- not null
- Returns:
- the best name of the package for the generated mojo
 
- 
isMavenReport@Deprecated public static boolean isMavenReport(String impl, org.apache.maven.project.MavenProject project) throws IllegalArgumentException Deprecated.UsePluginUtils.isMavenReport(String, MavenProject)instead.- Parameters:
- impl- a Mojo implementation, not null
- project- a MavenProject instance, could be null
- Returns:
- trueis the Mojo implementation implements- MavenReport,- falseotherwise.
- Throws:
- IllegalArgumentException- if any
 
 
- 
PluginUtils.isMavenReport(String, MavenProject)instead.