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.
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;
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"))
Run script: java -cp './*:.' clojure.main get-sonar-data.clj
最新文章
- adobe premiere pro cc2015.0已停止工作 解决办法
- Open Xml 读取Excel中的图片
- unity3d 射弹基础案例代码分析
- iOS键盘监听的通知
- MySQL_杭州北仓 12.3-12.7需求活动期间累计下单达到3天及以上的客户_20161212
- 无线客户端框架设计(2):项目结构的设计(iOS篇)
- ffmpeg视频格式转换(Java)
- php 去除数组中重复元素
- HNU13377:Book Club 二分图
- 解码美国传奇网络券商:TradeStation
- 修饰器模式(day04)
- Qt学习--部件深入--烤猪蹄
- 用curl自动登录HTTPS站点
- ubuntu PHP相关操作
- div和span标签
- Javascript面向对象编程:非构造函数的继承
- C# 简单的 Job 作业~
- 第1节 常用DOS(磁盘操作系统)命令
- 跟我学SharePoint 2013视频培训课程——什么是SharePoint 2013(1)
- Jquery函数大全 - 案例说明