   (let [snapshot? (.endsWith version-string snapshot-indicator)
         version-string (if snapshot?
                          (.substring version-string 0 (- (.length version-string)
-                                                         (.length ^String snapshot-indicator))))
+                                                         (.length ^String snapshot-indicator)))
+                         version-string)
         matcher (re-matcher version-regex version-string)
         groups (vec (drop 1 (re-find matcher)))]
     (when-not (seq groups)

                   (str "-"
                    (.format (SimpleDateFormat. "yyyy-MM-dd-hh-mm") (Date.)))
                   ""))
    (if (= "" (or (get version :rest) ""))
      (update version :bugfix #(inc (or % 0)))
      (assoc version :rest ""))))


(defn ^:private project-version


(defn ^:private version->string
  [version]
  (format "%s.%s.%s%s%s" (:major version) (:minor version) (:bugfix version)
          (:rest version) (if (:snapshot? version) "-SNAPSHOT" "")))


(defn ^:private write-version-to-project
