Class DefaultMavenPluginManager

  • All Implemented Interfaces:
    MavenPluginManager

    @Component(role=MavenPluginManager.class)
    public class DefaultMavenPluginManager
    extends java.lang.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 java.lang.String KEY_EXTENSIONS_REALMS
      PluginId => ExtensionRealmCache.CacheRecord map MavenProject context value key.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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​(java.lang.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, java.lang.String goal, java.util.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, java.util.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​(java.lang.Object mojo, MojoExecution mojoExecution)
      Releases the specified mojo back to the container.
      ExtensionRealmCache.CacheRecord 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, java.lang.ClassLoader parent, java.util.List<java.lang.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 Detail

      • KEY_EXTENSIONS_REALMS

        public static final java.lang.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 Detail

      • DefaultMavenPluginManager

        public DefaultMavenPluginManager()