Class MavenPluginContainer

java.lang.Object
io.spring.initializr.generator.buildsystem.maven.MavenPluginContainer

public class MavenPluginContainer extends Object
A container for MavenPlugins.
Author:
HaiTao Zhang
  • Constructor Details

    • MavenPluginContainer

      public MavenPluginContainer()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specify if this container is empty.
      Returns:
      true if no MavenPlugin is added
    • has

      public boolean has(String groupId, String artifactId)
      Specify if this container has a plugin with the specified groupId and artifactId.
      Parameters:
      groupId - the groupId of the plugin
      artifactId - the artifactId of the plugin
      Returns:
      true if an item with the specified groupId and artifactId exists
    • values

      public Stream<MavenPlugin> values()
      Returns a Stream of registered MavenPlugins.
      Returns:
      a stream of MavenPlugins
    • add

      public void add(String groupId, String artifactId)
      Add a MavenPlugin with the specified groupId and artifactId. Does nothing if the plugin has already been added.
      Parameters:
      groupId - the groupId of the plugin
      artifactId - the artifactId of the plugin
      See Also:
    • add

      public void add(String groupId, String artifactId, Consumer<MavenPlugin.Builder> plugin)
      Add a MavenPlugin with the specified groupId and artifactId and Consumer to customize the plugin. If the plugin has already been added, the consumer can be used to further tune the existing plugin configuration.
      Parameters:
      groupId - the groupId of the plugin
      artifactId - the artifactId of the plugin
      plugin - a Consumer to customize the MavenPlugin
    • remove

      public boolean remove(String groupId, String artifactId)
      Remove the plugin with the specified groupId and artifactId.
      Parameters:
      groupId - the groupId of the plugin to remove
      artifactId - the artifactId of the plugin to remove
      Returns:
      true if such a plugin was registered, false otherwise