Clojure program reading its own MANIFEST.MF

Posted by Ralph on Stack Overflow See other posts from Stack Overflow or by Ralph
Published on 2010-05-01T18:13:52Z Indexed on 2010/05/01 18:17 UTC
Read the original article Hit count: 288

Filed under:
|

How can a Clojure program find its own MANIFEST.MF (assuming it is packaged in a JAR file).

I am trying to do this from my "-main" function, but I can't find a class to use in the following code:

  (.getValue
    (..
      (java.util.jar.Manifest.
        (.openStream
          (java.net.URL.
            (str
              "jar:"
              (..
                (class **WHAT-GOES-HERE**)
                getProtectionDomain
                getCodeSource
                getLocation)
              "!/META-INF/MANIFEST.MF"))))
      getMainAttributes)
    "Build-number"))

Thanks.

© Stack Overflow or respective owner

Related posts about clojure

Related posts about manifest