    r ref REF       str    "The git reference for the desired file tree."]
 
   (let [tgt (core/tmp-dir!)]
-    (core/with-pre-wrap fileset
+    (core/with-pre-wrap [fs]
       (core/empty-dir! tgt)
       (util/info "Adding repo files...\n")
       (doseq [p (core/git-files :ref ref :untracked untracked)]
         (file/copy-with-lastmod (io/file p) (io/file tgt p)))
-      (-> fileset (core/add-resource tgt) core/commit!))))
+      (-> fs (core/add-resource tgt) core/commit!))))
 
 (core/deftask uber
   "Add jar entries from dependencies to fileset.

                        (require 'boot.repl-server)
                        ((resolve 'boot.repl-server/start-server) srv-opts))
        repl-cli (delay (pod/with-call-worker (boot.repl-client/client ~cli-opts)))]
    (comp
      (core/with-pre-wrap fileset
        (when (or server (not client)) @repl-svr)
        fileset)
      (core/with-post-wrap _
        (when (or client (not server)) @repl-cli)))))

(core/deftask pom
  "Create project pom.xml file.

   V ensure-version VER   str      "The version the jar's pom must contain."]

  (let [tgt (core/tmp-dir!)]
    (core/with-pass-thru [fs]
      (core/empty-dir! tgt)
      (let [jarfiles (or (and file [(io/file file)])
                         (->> (core/output-files fs)
                              (core/by-ext [".jar"])
                              ((if (seq file-regex) #(core/by-re file-regex %) identity))
                              (map core/tmp-file)))
            ; Get options from Boot env by repo name
            r        (get (->> (core/get-env :repositories) (into {})) repo)
            repo-map (merge
                       ; Repo option in env might be given as only url instead of map
                       (if (map? r) r {:url r})
                       repo-map)]
        (when-not (and repo-map (seq jarfiles))
          (throw (Exception. "missing jar file or repo not found")))
        (doseq [f jarfiles]
          (let [{{t :tag} :scm
                 v :version} (pod/with-call-worker (boot.pom/pom-xml-parse ~(.getPath f)))
                b            (util/guard (git/branch-current))
                commit       (util/guard (git/last-commit))
                tags         (util/guard (git/ls-tags))
                clean?       (util/guard (git/clean?))
                snapshot?    (.endsWith v "-SNAPSHOT")
                artifact-map (when gpg-sign
                               (util/info "Signing %s...\n" (.getName f))
                               (gpg/sign-jar tgt f {:gpg-key gpg-user-id
                                                    :gpg-passphrase gpg-passphrase}))]
            (assert (or (not ensure-branch) (= b ensure-branch))
                    (format "current git branch is %s but must be %s" b ensure-branch))
            (assert (or (not ensure-clean) clean?)
                    "project repo is not clean")
            (assert (or (not ensure-release) (not snapshot?))
                    (format "not a release version (%s)" v))
            (assert (or (not ensure-snapshot) snapshot?)
                    (format "not a snapshot version (%s)" v))
            (assert (or (not ensure-tag) (not t) (= t ensure-tag))
                    (format "scm tag in pom doesn't match (%s, %s)" t ensure-tag))
            (when (and ensure-tag (not t))
              (util/warn "The --ensure-tag option was specified but scm info is missing from pom.xml\n"))
            (assert (or (not ensure-version) (= v ensure-version))
                    (format "jar version doesn't match project version (%s, %s)" v ensure-version))
            (util/info "Deploying %s...\n" (.getName f))
            (pod/with-call-worker
              (boot.aether/deploy ~(core/get-env) ~[repo repo-map] ~(.getPath f) ~artifact-map))
            (when tag
              (if (and tags (= commit (get tags tag)))
                (util/info "Tag %s already created for %s\n" tag commit)
                (do
                  (util/info "Creating tag %s...\n" v)
                  (git/tag v "release"))))))))))
