Class SubArtifact

java.lang.Object
org.eclipse.aether.artifact.AbstractArtifact
org.eclipse.aether.util.artifact.SubArtifact
All Implemented Interfaces:
org.eclipse.aether.artifact.Artifact

public final class SubArtifact extends org.eclipse.aether.artifact.AbstractArtifact
An artifact whose identity is derived from another artifact. Note: Instances of this class are immutable and the exposed mutators return new objects rather than changing the current instance.
  • Constructor Details

    • SubArtifact

      public SubArtifact(org.eclipse.aether.artifact.Artifact mainArtifact, String classifier, String extension)
      Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.
      Parameters:
      mainArtifact - The artifact from which to derive the identity, must not be null.
      classifier - The classifier for this artifact, may be null if none.
      extension - The extension for this artifact, may be null if none.
    • SubArtifact

      public SubArtifact(org.eclipse.aether.artifact.Artifact mainArtifact, String classifier, String extension, File file)
      Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.
      Parameters:
      mainArtifact - The artifact from which to derive the identity, must not be null.
      classifier - The classifier for this artifact, may be null if none.
      extension - The extension for this artifact, may be null if none.
      file - The file for this artifact, may be null if unresolved.
    • SubArtifact

      public SubArtifact(org.eclipse.aether.artifact.Artifact mainArtifact, String classifier, String extension, Path path)
      Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.
      Parameters:
      mainArtifact - The artifact from which to derive the identity, must not be null.
      classifier - The classifier for this artifact, may be null if none.
      extension - The extension for this artifact, may be null if none.
      path - The file for this artifact, may be null if unresolved.
      Since:
      2.0.0
    • SubArtifact

      public SubArtifact(org.eclipse.aether.artifact.Artifact mainArtifact, String classifier, String extension, Map<String,String> properties)
      Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.
      Parameters:
      mainArtifact - The artifact from which to derive the identity, must not be null.
      classifier - The classifier for this artifact, may be null if none.
      extension - The extension for this artifact, may be null if none.
      properties - The properties of the artifact, may be null.
    • SubArtifact

      public SubArtifact(org.eclipse.aether.artifact.Artifact mainArtifact, String classifier, String extension, Map<String,String> properties, File file)
      Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.
      Parameters:
      mainArtifact - The artifact from which to derive the identity, must not be null.
      classifier - The classifier for this artifact, may be null if none.
      extension - The extension for this artifact, may be null if none.
      properties - The properties of the artifact, may be null.
      file - The file for this artifact, may be null if unresolved.
    • SubArtifact

      public SubArtifact(org.eclipse.aether.artifact.Artifact mainArtifact, String classifier, String extension, Map<String,String> properties, Path path)
      Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.
      Parameters:
      mainArtifact - The artifact from which to derive the identity, must not be null.
      classifier - The classifier for this artifact, may be null if none.
      extension - The extension for this artifact, may be null if none.
      properties - The properties of the artifact, may be null.
      path - The file for this artifact, may be null if unresolved.
      Since:
      2.0.0
  • Method Details

    • getGroupId

      public String getGroupId()
    • getArtifactId

    • getVersion

      public String getVersion()
    • getBaseVersion

      Specified by:
      getBaseVersion in interface org.eclipse.aether.artifact.Artifact
      Overrides:
      getBaseVersion in class org.eclipse.aether.artifact.AbstractArtifact
    • isSnapshot

      public boolean isSnapshot()
      Specified by:
      isSnapshot in interface org.eclipse.aether.artifact.Artifact
      Overrides:
      isSnapshot in class org.eclipse.aether.artifact.AbstractArtifact
    • getClassifier

    • getExtension

      public String getExtension()
    • getFile

      Deprecated.
    • getPath

      public Path getPath()
      Specified by:
      getPath in interface org.eclipse.aether.artifact.Artifact
      Overrides:
      getPath in class org.eclipse.aether.artifact.AbstractArtifact
    • setFile

      @Deprecated public org.eclipse.aether.artifact.Artifact setFile(File file)
      Deprecated.
      Specified by:
      setFile in interface org.eclipse.aether.artifact.Artifact
      Overrides:
      setFile in class org.eclipse.aether.artifact.AbstractArtifact
    • setPath

      public org.eclipse.aether.artifact.Artifact setPath(Path path)
      Specified by:
      setPath in interface org.eclipse.aether.artifact.Artifact
      Overrides:
      setPath in class org.eclipse.aether.artifact.AbstractArtifact
    • getProperties

    • setProperties

      public org.eclipse.aether.artifact.Artifact setProperties(Map<String,String> properties)
      Specified by:
      setProperties in interface org.eclipse.aether.artifact.Artifact
      Overrides:
      setProperties in class org.eclipse.aether.artifact.AbstractArtifact