Class Dependency

java.lang.Object
org.apache.maven.api.plugin.descriptor.Dependency
All Implemented Interfaces:
Serializable

@Experimental @Generated @ThreadSafe @Immutable public class Dependency extends Object implements Serializable
Definition of a dependency, needed by the plugin at runtime.
See Also:
  • Method Details

    • getGroupId

      public String getGroupId()
      The group id of the dependency.
      Returns:
      a String
    • getArtifactId

      public String getArtifactId()
      The artifact id of the dependency.
      Returns:
      a String
    • getVersion

      public String getVersion()
      The version of the dependency.
      Returns:
      a String
    • getType

      public String getType()
      The type of dependency.
      Returns:
      a String
    • with

      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withGroupId

      @Nonnull public Dependency withGroupId(String groupId)
      Creates a new Dependency instance using the specified groupId.
      Parameters:
      groupId - the new String to use
      Returns:
      a Dependency with the specified groupId
    • withArtifactId

      @Nonnull public Dependency withArtifactId(String artifactId)
      Creates a new Dependency instance using the specified artifactId.
      Parameters:
      artifactId - the new String to use
      Returns:
      a Dependency with the specified artifactId
    • withVersion

      @Nonnull public Dependency withVersion(String version)
      Creates a new Dependency instance using the specified version.
      Parameters:
      version - the new String to use
      Returns:
      a Dependency with the specified version
    • withType

      @Nonnull public Dependency withType(String type)
      Creates a new Dependency instance using the specified type.
      Parameters:
      type - the new String to use
      Returns:
      a Dependency with the specified type
    • newInstance

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

      @Nonnull public static Dependency newInstance(boolean withDefaults)
      Creates a new Dependency 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 Dependency
    • newBuilder

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

      @Nonnull public static Dependency.Builder newBuilder(boolean withDefaults)
      Creates a new Dependency 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 Dependency.Builder newBuilder(Dependency from)
      Creates a new Dependency builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Dependency instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

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