Class Artifact

java.lang.Object
org.savantbuild.dep.domain.Artifact
Direct Known Subclasses:
ReifiedArtifact

public class Artifact extends Object

This class defines an artifact as it exists across all projects, dependencies, etc. This class is the representation of the artifact that is defined by its group, project, name, type and version. This object is also the representation of a dependency between two project's.

See the Artifact(String) constructor for String formats of artifacts.

  • Field Details

    • exclusions

      public final List<ArtifactID> exclusions
    • id

      public final ArtifactID id
    • nonSemanticVersion

      public final String nonSemanticVersion
    • skipCompatibilityCheck

      public final boolean skipCompatibilityCheck
    • version

      public final org.savantbuild.domain.Version version
  • Constructor Details

    • Artifact

      public Artifact(ArtifactID id, org.savantbuild.domain.Version version)
      Shorthand for Artifact(ArtifactID, Version, List) that passes in null for the exclusions.
    • Artifact

      public Artifact(ArtifactID id, org.savantbuild.domain.Version version, List<ArtifactID> exclusions)
      Constructs an Artifact with the given ID and version.
      Parameters:
      id - The artifact ID (group, project, name, type).
      version - The version of the artifact.
    • Artifact

      public Artifact(ArtifactID id, org.savantbuild.domain.Version version, String nonSemanticVersion, List<ArtifactID> exclusions)
      Shorthand for Artifact(ArtifactID, Version, String, boolean, List) that passes in false for the compatibility check.
    • Artifact

      public Artifact(ArtifactID id, org.savantbuild.domain.Version version, String nonSemanticVersion, boolean skipCompatibilityCheck, List<ArtifactID> exclusions)
      Constructs an Artifact with the given ID and version.
      Parameters:
      id - The artifact ID (group, project, name, type).
      version - The version of the artifact.
      nonSemanticVersion - The non-semantic version.
      skipCompatibilityCheck - Whether compatibility checks should be skipped or run.
      exclusions - Any exclusions.
    • Artifact

      public Artifact(String spec)
      Shorthand for Artifact(String, String, boolean, List) that passes in null for the exclusions.
    • Artifact

      public Artifact(String spec, String nonSemanticVersion, boolean skipCompatibilityCheck, List<ArtifactID> exclusions)

      Parses the given specification to build an artifact. The currently supported spec formats are:

         group:project:version
         group:project:version:type
         group:project:name:version:type
       

      Examples:

         org.savantbuild.dep:savant-dependency-management:0.1
         org.savantbuild.dep:savant-dependency-management:0.1:jar
         org.savantbuild.dep:savant-dependency-management:some-other-artifact:0.1:jar
       
      Parameters:
      spec - The spec.
      nonSemanticVersion - The non-semantic version of this artifact that the project might depend on.
      skipCompatibilityCheck - Determines if the compatibility check is skipped for this artifact or not.
      exclusions - (Optional) Any exclusions of the artifact.
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getArtifactAlternativeSourceFile

      public String getArtifactAlternativeSourceFile()

      Returns the artifact source file name in the alternative (Maven style) format. This does not include any path information at all and would look something like this:

       common-collections-2.1-sources.jar
       
      Returns:
      The source file name.
    • getArtifactFile

      public String getArtifactFile()

      Returns the artifact file name. This does not include any path information at all and would look something like this:

       common-collections-2.1.jar
       
      Returns:
      The file name.
    • getArtifactMetaDataFile

      public String getArtifactMetaDataFile()

      Returns the artifact MetaData file name. This does not include any path information at all and would look something like this:

       common-collections-2.1.jar.amd
       
      Returns:
      The MetaData file name.
    • getArtifactNonSemanticAlternativeSourceFile

      public String getArtifactNonSemanticAlternativeSourceFile()

      Returns the artifact source file name in the alternative (Maven style) format with the non-semantic version. This does not include any path information at all and would look something like this:

       common-collections-2.1.1.Final-sources.jar
       
      Returns:
      The source file name.
    • getArtifactNonSemanticFile

      public String getArtifactNonSemanticFile()

      Returns the artifact file name using the non-semantic version. This does not include any path information at all and would look something like this:

       common-collections-2.1.1.Final.jar
       
      Returns:
      The file name.
    • getArtifactNonSemanticPOMFile

      public String getArtifactNonSemanticPOMFile()

      Returns the artifact POM file name that uses the non-semantic version (if there is one). This does not include any path information at all and would look something like this:

       common-collections-2.1.1.Final.pom
       
      Returns:
      The file name.
    • getArtifactPOMFile

      public String getArtifactPOMFile()

      Returns the artifact POM file name. This does not include any path information at all and would look something like this:

       common-collections-2.1.pom
       
      Returns:
      The file name.
    • getArtifactSourceFile

      public String getArtifactSourceFile()

      Returns the artifact source file name. This does not include any path information at all and would look something like this:

       common-collections-2.1-src.jar
       
      Returns:
      The source file name.
    • getArtifactTestFile

      public String getArtifactTestFile()

      Returns the artifact test file name. This does not include any path information at all and would look something like this:

       common-collections-test-2.1.jar
       
      Returns:
      The file name.
    • getArtifactTestSourceFile

      public String getArtifactTestSourceFile()

      Returns the artifact test source file name. This does not include any path information at all and would look something like this:

       common-collections-test-2.1.jar
       
      Returns:
      The file name.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isIntegrationBuild

      public boolean isIntegrationBuild()
      Returns:
      Whether the version of this artifact is an integration build version.
    • toString

      public String toString()
      Overrides:
      toString in class Object