1.Sbt 依赖树

参考:
dependencyGraph sbt plugin
​​​https://github.com/jrudolph/sbt-dependency-graph​

安装插件
建立文件:./.sbt/1.0/plugins/plugins.sbt
添加内容:addSbtPlugin(“net.virtual-void” % “sbt-dependency-graph” % “0.9.0”)

插件启动
sbt:graphPlatform> dependencyTree
其他命令:​​​https://github.com/jrudolph/sbt-dependency-graph#main-tasks​

解决依赖:
1)使用依赖树:dependencyTree
2)查看相互依赖:whatDependsOn
whatDependsOn com.alibaba fastjson 1.2.41
3)查看jar内容:jar vtf com/google/inject/guice/3.0/guice-3.0.jar | grep
4)在sbt中排出:”org.apache.shiro” % “shiro-all” % “1.2.2”
exclude(“com.google.inject”, “guice”),

2.Sbt 获取第三方依赖

在/Users/huiyu/.sbt中加入repositories文件
[repositories]
maven-local
local
jd-lib-releases: ​​http://ip:80/libs-releases​​
jd-lib–snapshot-releases: ​​http://ip/libs-snapshots/​​

3.更新 MacPorts 索引

输入:

sudo port -v selfupdate

4.MacPorts 的常用命令

(1)搜索MacPorts索引中的软件

port search NAME

(2)安装新的软件

sudo port install NAME

(3)卸载已安装的软件

sudo port uninstall NAME

(4)查看版本较低的软件

port outdated

(5)升级版本较低的软件

sudo port upgrade outdated

5.传递参数到一个命令或任务以批处理模式

​https://www.scala-sbt.org/1.x/docs/Howto-Running-Commands.html​

$ sbt "project X" clean "~ compile"

将graph项目clean,其中四个子项目分别compile以及graph_web项目打包dist

graph_path=/Users/huiyu/ideaProject/graph
cd $graph_path && sbt clean && sbt "project graph_importer" compile
cd $graph_path && sbt "project gremlin_rpc_core" compile
cd $graph_path && sbt "project gremlin_rpc_server" compile
cd $graph_path && sbt "project graph_web" compile && sbt "project graph_web" dist