             "from jars "
             "where version not like '%-SNAPSHOT' "
             "and group_name = ? "
+            (when artifact-id "and jar_name = ? ")
             "group by group_name, jar_name) r "
             "on j.jar_name = r.jar_name "
             "and j.group_name = r.group_name "

            "order by j.group_name asc, j.jar_name asc"]
        (remove nil?)
        (apply str))
      (remove nil? [group-id group-id group-id group-id artifact-id])]
     :results)))

(defn get-artifact [group-id artifact-id]

            "left join "
            "(select jar_name, group_name, version, created from jars "
            "where group_name = ? "
            (when artifact-id "and jar_name = ? ")
            ") as r2 "
            "on j.jar_name = r2.jar_name "
            "and j.group_name = r2.group_name "
