Class MavenPlugin.Builder

java.lang.Object
io.spring.initializr.generator.buildsystem.maven.MavenPlugin.Builder
Enclosing class:
MavenPlugin

public static class MavenPlugin.Builder extends Object
Builder for a MavenPlugin.
  • Constructor Details

    • Builder

      protected Builder(String groupId, String artifactId)
  • Method Details

    • version

      public MavenPlugin.Builder version(String version)
      Set the version of the plugin or null if the version is managed by the project.
      Parameters:
      version - the version of the plugin or null
      Returns:
      this for method chaining
    • extensions

      public MavenPlugin.Builder extensions(boolean extensions)
      Set whether to load extensions of this plugin.
      Parameters:
      extensions - whether to load extensions
      Returns:
      this for method chaining
    • configuration

      public MavenPlugin.Builder configuration(Consumer<MavenPlugin.ConfigurationBuilder> configuration)
      Customize the configuration of the plugin using the specified consumer.
      Parameters:
      configuration - a consumer of the current configuration
      Returns:
      this for method chaining
    • execution

      Add an execution with the specified id and Consumer to customize the object. If the execution has already been¬ added, the consumer can be used to further tune the existing plugin execution
      Parameters:
      id - the id of the execution
      execution - a Consumer to customize the MavenPlugin.Execution
      Returns:
      this for method chaining
    • dependency

      public MavenPlugin.Builder dependency(String groupId, String artifactId, String version)
      Add a plugin dependency.
      Parameters:
      groupId - the group ID of the dependency
      artifactId - the artifact ID of the dependency
      version - the version of the dependency
      Returns:
      this for method chaining
    • build

      public MavenPlugin build()
      Build a MavenPlugin with the current state of this builder.
      Returns:
      a MavenBuild