Class Prerequisites

java.lang.Object
org.apache.maven.api.model.Prerequisites
All Implemented Interfaces:
Serializable, InputLocationTracker

@Experimental @Generated @ThreadSafe @Immutable public class Prerequisites extends Object implements Serializable, InputLocationTracker
Describes the prerequisites a project can have.
See Also:
  • Method Details

    • getMaven

      public String getMaven()
      For a plugin project (packaging is maven-plugin), the minimum version of Maven required to use the resulting plugin.
      In Maven 2, this was also specifying the minimum version of Maven required to build a project, but this usage is deprecated in Maven 3 and not checked any more: use the Maven Enforcer Plugin's requireMavenVersion rule instead.
      Returns:
      a String
    • getLocation

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
    • with

      @Nonnull public Prerequisites.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withMaven

      @Nonnull public Prerequisites withMaven(String maven)
      Creates a new Prerequisites instance using the specified maven.
      Parameters:
      maven - the new String to use
      Returns:
      a Prerequisites with the specified maven
    • newInstance

      @Nonnull public static Prerequisites newInstance()
      Creates a new Prerequisites instance. Equivalent to newInstance(true).
      Returns:
      a new Prerequisites
      See Also:
    • newInstance

      @Nonnull public static Prerequisites newInstance(boolean withDefaults)
      Creates a new Prerequisites instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Prerequisites
    • newBuilder

      @Nonnull public static Prerequisites.Builder newBuilder()
      Creates a new Prerequisites builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Prerequisites.Builder newBuilder(boolean withDefaults)
      Creates a new Prerequisites builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Prerequisites.Builder newBuilder(Prerequisites from)
      Creates a new Prerequisites builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Prerequisites instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Prerequisites.Builder newBuilder(Prerequisites from, boolean forceCopy)
      Creates a new Prerequisites builder instance using the specified object as a basis.
      Parameters:
      from - the Prerequisites instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder