Class GeneratorUtils

java.lang.Object
org.apache.maven.tools.plugin.generator.GeneratorUtils

public final class GeneratorUtils extends Object
Convenience methods to play with Maven plugins.
Author:
jdcasey
  • Method Details

    • writeDependencies

      public 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

      public static void element(org.codehaus.plexus.util.xml.XMLWriter w, String name, String value)
      Parameters:
      w - not null writer
      name - not null
      value - could be null
    • toComponentDependencies

      public 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
    • makeHtmlValid

      @Deprecated public static String makeHtmlValid(String description)
      Deprecated.
      Redundant for java extractor
      Fixes 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.
    • discoverPackageName

      public 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
      Parameters:
      impl - a Mojo implementation, not null
      project - a MavenProject instance, could be null
      Returns:
      true is the Mojo implementation implements MavenReport, false otherwise.
      Throws:
      IllegalArgumentException - if any