Class DefaultMavenPluginManager

java.lang.Object
org.apache.maven.plugin.internal.DefaultMavenPluginManager
All Implemented Interfaces:
MavenPluginManager

@Component(role=MavenPluginManager.class) public class DefaultMavenPluginManager extends Object implements MavenPluginManager
Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such that the plugins/mojos can be used in arbitrary contexts. In particular, the mojos can be used for ordinary build plugins as well as special purpose plugins like reports.
Since:
3.0
Author:
Benjamin Bentmann
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    PluginId => ExtensionRealmCache.CacheRecord map MavenProject context value key.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkRequiredMavenVersion(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
    Verifies the specified plugin is compatible with the current Maven runtime.
    <T> T
    getConfiguredMojo(Class<T> mojoInterface, MavenSession session, MojoExecution mojoExecution)
    Looks up the mojo for the specified mojo execution and populates its parameters from the configuration given by the mojo execution.
    org.apache.maven.plugin.descriptor.MojoDescriptor
    getMojoDescriptor(org.apache.maven.model.Plugin plugin, String goal, List<org.eclipse.aether.repository.RemoteRepository> repositories, org.eclipse.aether.RepositorySystemSession session)
    Retrieves the descriptor for the specified plugin goal from the plugin's main artifact.
    org.apache.maven.plugin.descriptor.PluginDescriptor
    getPluginDescriptor(org.apache.maven.model.Plugin plugin, List<org.eclipse.aether.repository.RemoteRepository> repositories, org.eclipse.aether.RepositorySystemSession session)
    Retrieves the descriptor for the specified plugin from its main artifact.
    void
    releaseMojo(Object mojo, MojoExecution mojoExecution)
    Releases the specified mojo back to the container.
    setupExtensionsRealm(MavenProject project, org.apache.maven.model.Plugin plugin, org.eclipse.aether.RepositorySystemSession session)
    Sets up class realm for the specified build extensions plugin.
    void
    setupPluginRealm(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor, MavenSession session, ClassLoader parent, List<String> imports, org.eclipse.aether.graph.DependencyFilter filter)
    Sets up the class realm for the specified plugin.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • KEY_EXTENSIONS_REALMS

      public static final String KEY_EXTENSIONS_REALMS

      PluginId => ExtensionRealmCache.CacheRecord map MavenProject context value key. The map is used to ensure the same class realm is used to load build extensions and load mojos for extensions=true plugins.

      Note: This is part of internal implementation and may be changed or removed without notice
      Since:
      3.3.0
  • Constructor Details

    • DefaultMavenPluginManager

      public DefaultMavenPluginManager()
  • Method Details