How do I exclude jars from a leiningen project?

前端 未结 1 631
旧时难觅i
旧时难觅i 2021-01-12 12:48

While using Leiningen, I got the following abrupt error:

Exception in thread \"main\" java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.getFileUtils()

相关标签:
1条回答
  • 2021-01-12 13:24

    In answer to (1) I'm not sure if he's saying that you need to exclude a specific version of Ant, but more likely that you can fix the issue by excluding the version of Ant that's pulled in by Autodoc (no matter what version). You could try something like:

    (defproject my-project "1.0.0"
      :dependencies [[org.clojure/clojure "1.2.0"]
                     [org.clojure/clojure-contrib "1.2.0"]]
      :dev-dependencies [[autodoc "0.7.1" :exclusions [org.apache.ant/ant]]])
    

    I've only excluded it in dev-dependencies here, assuming that Autodoc is only to be used during a build.

    For (2), you are correct, Leiningen is a script, but in the issue report, the author is suggesting an edit to the Leiningen script to fix the issue by changing the order of directories referenced in Leiningen's CLASSPATH.

    0 讨论(0)
提交回复
热议问题