The normal way of deploy clojure files is using leiningen. But if we have no leiningen, or the script is small and unnecessary to pack as a leiningen project, we can build a "bare" clojure script in the following way.java
Get the dependency jar files, 2 options:git
i. download the jar file directly;github
i. if the dependency project provide the dependency as leiningen dependency items in porject.clj (for example, "[org.clojure/data.json "0.2.3"]" in data.json), you can build the leiningen project following Parse Sonarqube Data via Web API in Clojure , then copy the denpendency jar files from the ~/.m2/repository folder;json
Build srcipt: get-sonar-data.cljapi
(require '[clojure.data.json :as json])ide
(def url "http://10.0.2.74:9000/api/resources?resource=ESB:com.boco.esb.analysismgr.service.impl&metrics=classes")ui
(def data (json/read-str (slurp url))) url
(println ((first data) "name"))orm
(println ((first ((first data) "msr")) "val")) ip
Run script: java -cp './*:.' clojure.main get-sonar-data.clj