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 Summary

    Modifier and Type
    Method
    Description
    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.
    static void
    element(org.codehaus.plexus.util.xml.XMLWriter w, String name, String value)
     
    static boolean
    isMavenReport(String impl, org.apache.maven.project.MavenProject project)
    Deprecated.
    Use PluginUtils.isMavenReport(String, MavenProject) instead.
    static List<org.codehaus.plexus.component.repository.ComponentDependency>
    toComponentDependencies(Collection<org.apache.maven.artifact.Artifact> artifacts)
     
    static void
    writeDependencies(org.codehaus.plexus.util.xml.XMLWriter w, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
    • 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
      Deprecated.
      Use PluginUtils.isMavenReport(String, MavenProject) instead.
      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