Class CoreExtension

java.lang.Object
org.apache.maven.cli.internal.extension.model.CoreExtension
All Implemented Interfaces:
Serializable

@Experimental @Generated @ThreadSafe @Immutable public class CoreExtension extends Object implements Serializable
Describes a build extension to utilise.
See Also:
  • Method Details

    • getGroupId

      public String getGroupId()
      The group ID of the extension's artifact.
      Returns:
      a String
    • getArtifactId

      public String getArtifactId()
      The artifact ID of the extension.
      Returns:
      a String
    • getVersion

      public String getVersion()
      The version of the extension.
      Returns:
      a String
    • getClassLoadingStrategy

      public String getClassLoadingStrategy()
      The class loading strategy: 'self-first' (the default), 'parent-first' (loads classes from the parent, then from the extension) or 'plugin' (follows the rules from extensions defined as plugins).
      Returns:
      a String
    • getConfiguration

      public XmlNode getConfiguration()
      Returns:
      a XmlNode
    • with

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

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

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

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

      @Nonnull public CoreExtension withClassLoadingStrategy(String classLoadingStrategy)
      Creates a new CoreExtension instance using the specified classLoadingStrategy.
      Parameters:
      classLoadingStrategy - the new String to use
      Returns:
      a CoreExtension with the specified classLoadingStrategy
    • withConfiguration

      @Nonnull public CoreExtension withConfiguration(XmlNode configuration)
      Creates a new CoreExtension instance using the specified configuration.
      Parameters:
      configuration - the new XmlNode to use
      Returns:
      a CoreExtension with the specified configuration
    • newInstance

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

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

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

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

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

      public String getId()
      Gets the identifier of the extension.
      Returns:
      The extension id in the form <groupId>:<artifactId>:<version>, never null.