jvm.artifact

artifact

added in 3.0

(artifact x)(artifact type x)

converts various artifact formats

(artifact :string ’hara/hara “2.4.0”) => “hara:hara:jar:2.4.0”

(artifact :path “hara:hara:2.4.0”) => (str base/local-repo “/hara/hara/2.4.0/hara-2.4.0.jar”)

artifact-coord

added in 3.0

(artifact-coord x)(artifact-coord _ x)

converts an artifact in any format to the coord representation

(artifact-coord “hara:hara:jar:2.4.0”) => ’hara/hara “2.4.0”

artifact-default

added in 3.0

(artifact-default x)(artifact-default _ x)

converts an artifact in any format to the default representation

(artifact-default ’hara/hara “2.4.0”) => rep?

artifact-path

added in 3.0

(artifact-path x)(artifact-path _ x)

converts an artifact in any format to the path representation

(artifact-path ’hara/hara “2.4.0”) => “<.m2>/hara/hara/2.4.0/hara-2.4.0.jar”

artifact-string

added in 3.0

(artifact-string x)(artifact-string _ x)

converts an artifact in any format to the string representation

(artifact-string ’hara/hara “2.4.0”) => “hara:hara:jar:2.4.0”

artifact-symbol

added in 3.0

(artifact-symbol x)(artifact-symbol _ x)

converts an artifact in any format to the symbol representation

(artifact-symbol ’hara/hara “2.4.0”) => ’hara/hara

coord->rep

added in 3.0

(coord->rep [name version & {:keys [scope exclusions]}])

converts a coord to a rep instance

(coord->rep ’hara/hara “2.4.0”) => (contains {:group “hara” :artifact “hara” :version “2.4.0”})

coord?

added in 3.0

(coord? obj)

checks for a valid coordinate

(coord? ’org.clojure/clojure “1.8.0”) => true

(coord? ’1 2 3) => false

path->rep

added in 3.0

(path->rep x)

converts a path to a rep instance

(path->rep (str base/local-repo “/hara/hara/2.4.0/hara-2.4.0.jar”)) => (contains {:group “hara” :artifact “hara” :version “2.4.0”})

rep

added in 3.0

(rep obj)

converts various formats to a rep

(str (rep ’hara/hara “2.4.0”)) => “hara:hara:jar:2.4.0”

(str (rep “hara:hara:2.4.0”)) => “hara:hara:jar:2.4.0”

rep->coord

added in 3.0

(rep->coord {:keys [group artifact version exclusions scope]})

encodes the rep to a coordinate

(-> {:group “hara” :artifact “hara” :version “2.4.0”} (map->Rep) (rep->coord)) => ’hara/hara “2.4.0”

rep->path

added in 3.0

(rep->path {:keys [group artifact version extension]})

encodes the rep to a path

(-> {:group “hara” :artifact “hara” :version “2.4.0”} (map->Rep) (rep->path)) => #“/hara/hara/2.4.0/hara-2.4.0.jar”

rep->string

added in 3.0

(rep->string {:keys [group artifact extension version]})

encodes the rep to a string

(-> {:group “hara” :artifact “hara” :version “2.4.0”} (map->Rep) (rep->string)) => “hara:hara:2.4.0”

rep-default

added in 3.0

(rep-default x)

creates the default representation of a artifact

(into {} (rep-default “hara:hara:2.4.0”)) => {:properties {}, :group “hara”, :classifier nil, :file nil, :exclusions nil, :scope nil, :extension “jar”, :artifact “hara”, :version “2.4.0”}

rep?

added in 3.0

(rep? obj)

checks if an object is of type jvm.artifact.Rep

(rep? (rep “hara:hara:2.4.0”)) => true

string->rep

added in 3.0

(string->rep s)

converts a string to a rep instance

(string->rep “hara:hara:2.4.0”) => (contains {:group “hara” :artifact “hara” :version “2.4.0”})