Class Artifact
- Direct Known Subclasses:
ReifiedArtifact
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 Summary
FieldsModifier and TypeFieldDescriptionfinal List<ArtifactID>final ArtifactIDfinal Stringfinal booleanfinal org.savantbuild.domain.Version -
Constructor Summary
ConstructorsConstructorDescriptionShorthand forArtifact(String, String, boolean, List)that passes in null for the exclusions.Artifact(String spec, String nonSemanticVersion, boolean skipCompatibilityCheck, List<ArtifactID> exclusions) Parses the given specification to build an artifact.Artifact(ArtifactID id, org.savantbuild.domain.Version version) Shorthand forArtifact(ArtifactID, Version, List)that passes in null for the exclusions.Artifact(ArtifactID id, org.savantbuild.domain.Version version, String nonSemanticVersion, boolean skipCompatibilityCheck, List<ArtifactID> exclusions) Constructs an Artifact with the given ID and version.Artifact(ArtifactID id, org.savantbuild.domain.Version version, String nonSemanticVersion, List<ArtifactID> exclusions) Shorthand forArtifact(ArtifactID, Version, String, boolean, List)that passes in false for the compatibility check.Artifact(ArtifactID id, org.savantbuild.domain.Version version, List<ArtifactID> exclusions) Constructs an Artifact with the given ID and version. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the artifact source file name in the alternative (Maven style) format.Returns the artifact file name.Returns the artifact MetaData file name.Returns the artifact source file name in the alternative (Maven style) format with the non-semantic version.Returns the artifact file name using the non-semantic version.Returns the artifact POM file name that uses the non-semantic version (if there is one).Returns the artifact POM file name.Returns the artifact source file name.Returns the artifact test file name.Returns the artifact test source file name.inthashCode()booleantoString()
-
Field Details
-
exclusions
-
id
-
nonSemanticVersion
-
skipCompatibilityCheck
public final boolean skipCompatibilityCheck -
version
public final org.savantbuild.domain.Version version
-
-
Constructor Details
-
Artifact
Shorthand forArtifact(ArtifactID, Version, List)that passes in null for the exclusions. -
Artifact
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 forArtifact(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
Shorthand forArtifact(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
-
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
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
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
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
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
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
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
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
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
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() -
isIntegrationBuild
public boolean isIntegrationBuild()- Returns:
- Whether the version of this artifact is an integration build version.
-
toString
-