Class ArtifactItem


public class ArtifactItem extends EntityPropertiesBuilder<ArtifactItemProperties>
Represents an artifact or group of artifacts, obtained using one of the following methods.
  • declared in the job (as local or shared artifact)
  • subscribed by the job (from a job from a previous stage)
  • downloaded using Artifact Downloader task (from another plan)
Examples:
 // all artifacts from a current plan
 new ArtifactItem()

 // an artifact from a current plan
 new ArtifactItem()
     .artifact("name")

 // an artifact from another plan
 new ArtifactItem()
     .sourcePlan(new PlanIdentifier("PROJ", "PLAN"))
     .artifact("name")
 
  • Constructor Details

    • ArtifactItem

      public ArtifactItem()
  • Method Details

    • sourcePlan

      public ArtifactItem sourcePlan(@NotNull @NotNull PlanIdentifier planIdentifier)
      Specify from which plan a downloaded artifact shall be taken. Note that by using few Artifact Downloader tasks you can download several artifacts having the same name. This is to distinguish them. In case a source plan is not specified, the current plan will be used.
      Parameters:
      planIdentifier - a project-plan key, e.g. "MYPROJECT-MYPLAN"
      Returns:
      ArtifactItem this
    • artifact

      public ArtifactItem artifact(@NotNull @NotNull String artifactName)
      Specify that only one downloaded artifact shall be taken.
      Parameters:
      artifactName - name of the downloaded artifact
      Returns:
      ArtifactItem this
    • allArtifacts

      public ArtifactItem allArtifacts()
      Specify that all downloaded artifacts shall be taken.
      Returns:
      ArtifactItem this
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • build

      protected ArtifactItemProperties build()
      Specified by:
      build in class EntityPropertiesBuilder<ArtifactItemProperties>