Class Exclusion

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

The <exclusion> element contains informations required to exclude an artifact to the project.

The groupId and artifactId fields are interpreted as glob patterns, see FileSystem.getPathMatcher(java.lang.String).

See Also:
  • Method Details

    • getGroupId

      public String getGroupId()
      The group ID of the project to exclude.
      Returns:
      a String
    • getArtifactId

      public String getArtifactId()
      The artifact ID of the project to exclude.
      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 Exclusion.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withGroupId

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

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

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

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

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

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

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