Skip to content

Commit

Permalink
skip duplicated entry when add file to war
Browse files Browse the repository at this point in the history
  • Loading branch information
dkonishi committed Mar 21, 2019
1 parent d67b920 commit da92c4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(defproject lein-ring "0.12.5"
(defproject dkonishi/lein-ring "0.12.5"
:description "Leiningen Ring plugin"
:url "https://github.com/weavejester/lein-ring"
:url "https://github.com/dkonishi/lein-ring"
:scm {:name "git"
:url "https://github.com/weavejester/lein-ring"}
:url "https://github.com/dkonishi/lein-ring"}
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/core.unify "0.5.7"]
Expand Down
9 changes: 7 additions & 2 deletions src/leiningen/ring/war.clj
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,13 @@

(defmulti write-entry (fn [war _ _] (class war)))
(defmethod write-entry JarOutputStream [war war-path entry]
(.putNextEntry war (JarEntry. war-path))
(io/copy entry war))
(try
(.putNextEntry war (JarEntry. war-path))
(io/copy entry war))
(catch ZipException e
(println (str "[WARN] \"" (.getName jar-entry)
"\" is already included on war file and it won't be included again."))))

(defmethod write-entry File [war-dir war-path file-or-data]
(let [to-file (io/file war-dir war-path)]
(io/make-parents to-file)
Expand Down

0 comments on commit da92c4a

Please sign in to comment.