zoukankan      html  css  js  c++  java
  • Run Clojure Script with External Dependencies without leiningen

    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.

    1. Get the dependency jar files, 2 options:

      i. download the jar file directly;

      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;

    2. Build srcipt: get-sonar-data.clj

      (require '[clojure.data.json :as json])

      (def url "http://10.0.2.74:9000/api/resources?resource=ESB:com.boco.esb.analysismgr.service.impl&metrics=classes")

      (def data (json/read-str (slurp url)))

      (println ((first data) "name"))

      (println ((first ((first data) "msr")) "val"))

    3. Run script: java -cp './*:.' clojure.main get-sonar-data.clj

  • 相关阅读:
    两个不同于LR和jmeter的性能测试工具
    一个基于集成jenkins的测试平台
    sparkR原理
    Python 出现需要使用fPIC重新编译的问题
    eclipse中使用jython
    R中逻辑运算
    R语言的一些笔记
    Distributed R
    R语言和大数据
    Mysql command line
  • 原文地址:https://www.cnblogs.com/darkmatter/p/3612454.html
Copyright © 2011-2022 走看看