      (war project (default-war-name project)))
   ([project war-name]
      (ensure-handler-set! project)
-     (let [project (add-servlet-dep project)
+;     (let [project (add-servlet-dep project)
+      (let [project (-> project
+                        add-servlet-dep
+                        unmerge-profiles)
            result  (compile/compile project)]
        (when-not (and (number? result) (pos? result))
          (let [war-path (war-file-path project war-name)]

  (:require [leiningen.compile :as compile]
            [clojure.java.io :as io]
            [clojure.string :as string]
            [leinjacker.deps :as deps])
  (:use [clojure.data.xml :only [sexp-as-element indent-str]]
        leiningen.ring.util)

      (dir-entry war-stream project "" path))
    war-stream))

(defn unmerge-profiles [project]
  (if-let [unmerge-fn (and (= 2 (lju/lein-generation))
                           (lju/try-resolve 'leiningen.core.project/unmerge-profiles))]
    (unmerge-fn project [:default])
    project))
        
(defn add-servlet-dep [project]
  (deps/add-if-missing project '[ring/ring-servlet "1.2.1"]))

