                                           services)))
                             ;; modules))
 
-          wardirs (remove nil?
-                          (into [] (map #(if (:wardir %)
-                                           (.getAbsolutePath (io/file (:wardir %)))
-                                           nil)
+          wardirs (if services
+                    (remove nil?
+                            (into [] (map #(if (:wardir %)
+                                             (.getAbsolutePath (io/file (:wardir %)))
+                                             nil)
                                           services)))
+                    ["target"])
 
           _ (println "WARDIRS: " wardirs)
 

                                                     (count servlets-edn-files)))))
                     servlets-edn-map (-> (boot/tmp-file servlets-edn-f) slurp read-string)
                     servlets-config-map (normalize-servlet-configs servlets-edn-map)
                     servlets-config-map {:servlets (filter #(nil? (:class %))
                                                            (:servlets servlets-config-map))}

                     ;; step 2: inject servlets config map into master config map
                     master-config (-> boot-config-edn-map (assoc-in [:servlets]


(defn- normalize-servlet-configs
  [configs]
  ;;(println "normalizing servlet config: " configs)
  {:servlets
   (vec (flatten (for [config (:servlets configs)]
          (let [urls (into [] (for [url (:urls config)]
                                {:path (str url)}))
                class  (str/replace (:ns config) "-" "_")
                ns (if (:ns config) (:ns config) (:class config)) ]
            (merge config {:urls urls
                           :class class
                           :servlet {:ns (:ns config)}})))))})

(boot/deftask servlets
  "generate servlets class files"
