我需要列出所有的sbt依赖项,以检查是否已经存在debian包(我也注意到有一个DEB包,但外部依赖似乎没有打包)。
目前,我通过以下步骤列出了sbt依赖项:
您认为列出所有sbt依赖项的正确方法吗?
发布于 2016-01-04 00:20:37
有一个不错的sbt plugin:https://github.com/jrudolph/sbt-dependency-graph
简单地添加到~/.sbt/0.13/plugins/plugins.sbt
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.0")调用sbt dependencyTree可以得到"ascii图“,如:
...
[info] | +-org.apache.lucene:lucene-spatial:4.10.2
[info] | | +-com.spatial4j:spatial4j:0.4.1
[info] | | +-org.apache.lucene:lucene-core:4.10.2
[info] | | +-org.apache.lucene:lucene-queries:4.10.2
[info] | | +-org.apache.lucene:lucene-core:4.10.2
[info] | |
[info] | +-org.apache.lucene:lucene-suggest:4.10.2
[info] | +-org.apache.lucene:lucene-analyzers-common:4.10.2
[info] | | +-org.apache.lucene:lucene-core:4.10.2
[info] | |
[info] | +-org.apache.lucene:lucene-core:4.10.2
[info] | +-org.apache.lucene:lucene-misc:4.10.2
[info] | | +-org.apache.lucene:lucene-core:4.10.2
[info] | |
[info] | +-org.apache.lucene:lucene-queries:4.10.2
[info] | +-org.apache.lucene:lucene-core:4.10.2
...发布于 2020-04-03 13:49:41
如果不需要sbt-dependency-graph提供的依赖层次结构,下面的内容可能是有用的:
sbt 'show dependencyClasspathFiles'发布于 2020-07-10 21:49:00
只是在这里添加如何安装sbt-dependency-graph,,我认为这与问题相关。
重要信息:
答案仅仅是与sbt-dependency-graph.相关的部分完整的答案(sbt+scala+homebrew+plugin) --你可以找到这里
为了使用Snyk测试Scala项目,您需要安装Sbt依赖图插件。
为Sbt 0.13先决条件安装sbt依赖图插件
确保安装了Scala。
确保安装了sbt并运行了Sbt。
注意:下面的步骤将把Sbt依赖插件安装为全局插件。
cd ~/.sbtls命令将显示目录中是否存在0.13和/或1.0cd 0.13导航到0.13,然后通过键入:mkdir plugins创建一个名为plugins的目录cd plugins导航到新目录,然后通过键入:touch plugins.sbt继续创建一个名为“plugins.sbt”的文件addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")ls来检查是否存在1.0:- If the 1.0 does NOT exist in the sbt directory, type `mkdir 1.0` in the sbt directory- If 1.0 exists in the directory, run the following command: `cd ~/.sbt/1.0`- Make a directory called “plugins” in that folder by typing: `mkdir plugins` Copy the existing “plugins.sbt” file from the 0.13 directory to the current 1.0 directory by typing the following: `cp ../0.13/plugins/plugins.sbt ./plugins`- Validate that the plugin has been installed correctly by running the following command: `sbt "-Dsbt.log.noformat=true" dependencyTree` [important](/questions/tagged/important) **This should be tested in the directory of the project** and by running the command will generate the dependency graph. You can also run it each time you want to generate the dependency graph)https://stackoverflow.com/questions/34583171
复制相似问题