加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – addSbtPlugin(…)导致驱逐警告,但’evicted’命令不显

发布时间:2020-12-16 18:14:50 所属栏目:安全 来源:网络整理
导读:使用sbt 1.2.7和sbt-pgp插件,sbt显示驱逐警告. $rm -rf target project/target sbt ";clean;compile"[info] Loading global plugins from /home/kbigwheel/.sbt/1.0/plugins[info] Loading project definition from /home/kbigwheel/code/_investigation/201
使用sbt 1.2.7和sbt-pgp插件,sbt显示驱逐警告.

$rm -rf target project/target && sbt ";clean;compile"
[info] Loading global plugins from /home/kbigwheel/.sbt/1.0/plugins
[info] Loading project definition from /home/kbigwheel/code/_investigation/2019-01-04-evicted-warning-investigation-3/plugins/project/project
[info] Loading settings for project plugins-build from test.sbt ...
[info] Loading project definition from /home/kbigwheel/code/_investigation/2019-01-04-evicted-warning-investigation-3/plugins/project
[info] Updating ProjectRef(uri("file:/home/kbigwheel/code/_investigation/2019-01-04-evicted-warning-investigation-3/plugins/project/"),"plugins-build")...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Loading settings for project plugins from build.sbt ...
[info] Set current project to plugins (in build file:/home/kbigwheel/code/_investigation/2019-01-04-evicted-warning-investigation-3/plugins/)
[success] Total time: 0 s,completed 2019/01/05 13:27:05
[info] Updating ...
[info] Done updating.
[success] Total time: 0 s,completed 2019/01/05 13:27:05

但是,被驱逐的命令没有显示任何内容.

$sbt evicted
[info] Loading global plugins from /home/kbigwheel/.sbt/1.0/plugins
[info] Updating ProjectRef(uri("file:/home/kbigwheel/.sbt/1.0/plugins/"),"global-plugins")...
[info] Done updating.
[info] Loading project definition from /home/kbigwheel/proj-name/project/project
[info] Updating ProjectRef(uri("file:/home/kbigwheel/proj-name/project/project/"),"proj-name-build-build")...
[info] Done updating.
[info] Loading settings for project proj-name-build from test.sbt ...
[info] Loading project definition from /home/kbigwheel/proj-name/project
[info] Updating ProjectRef(uri("file:/home/kbigwheel/proj-name/project/"),"proj-name-build")...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Set current project to proj-name (in build file:/home/kbigwheel/proj-name/)
[info] Updating ...
[info] Done updating.
[success] Total time: 0 s,completed 2019/01/05 13:52:46

附加信息

>使用sbt 1.1.6,没有警告
>使用sbt 1.2.0,发生了警告
>使用sbt-sonatype,没有警告
>使用sbt-native-packager,发生了警告

因此,此警告必须在特定插件和sbt 1.2.0或更高版本中发生.

来源重现:https://github.com/bigwheel/sbt-unknown-evicted-warning

为什么警告显示?以及如何解决此消息?

解决方法

请记住,SBT is recuersive – 这意味着,SBT使用SBT来构建用于构建项目的SBT.

您所看到的驱逐警告不是针对您的主项目,而是针对元项目!
您可以使用reload plugins命令在元项目中运行evicted命令来检查.
(我将使用sbt作为shell而不是批处理命令执行程序,这对于开发来说更好更快).

$sbt
[info] Updated file /home/balmungsan/sbt-unknown-evicted-warning/project/build.properties: set sbt.version to 1.2.7
[info] Loading settings for project global-plugins from plugins.sbt ...
[info] Loading global plugins from /home/balmungsan/.sbt/1.0/plugins
[info] Loading project definition from /home/balmungsan/sbt-unknown-evicted-warning/project/project
[info] Updating ProjectRef(uri("file:/home/balmungsan/sbt-unknown-evicted-warning/project/project/"),"sbt-unknown-evicted-warning-build-build")...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Loading settings for project sbt-unknown-evicted-warning-build from plugins.sbt ...
[info] Loading project definition from /home/balmungsan/sbt-unknown-evicted-warning/project
[info] Updating ProjectRef(uri("file:/home/balmungsan/sbt-unknown-evicted-warning/project/"),"sbt-unknown-evicted-warning-build")...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Set current project to sbt-unknown-evicted-warning (in build file:/home/balmungsan/sbt-unknown-evicted-warning/)
[info] sbt server started at local:///home/balmungsan/.sbt/1.0/server/91ac4486f32705bdcc38/sock
sbt:sbt-unknown-evicted-warning> evicted
[info] Updating ...
[info] Done updating.
[success] Total time: 3 s,completed Jan 5,2019 9:49:12 AM

sbt:sbt-unknown-evicted-warning> reload plugins
[info] Loading settings for project global-plugins from plugins.sbt ...
[info] Loading global plugins from /home/balmungsan/.sbt/1.0/plugins
[info] Loading project definition from /home/balmungsan/sbt-unknown-evicted-warning/project/project
[info] Updating ProjectRef(uri("file:/home/balmungsan/sbt-unknown-evicted-warning/project/project/"),"project-build")...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Loading settings for project project from plugins.sbt ...
[info] Loading project definition from /home/balmungsan/sbt-unknown-evicted-warning/project

sbt:project> evicted
[info] Updating ProjectRef(uri("file:/home/balmungsan/sbt-unknown-evicted-warning/project/"),"project")...
[info] Done updating.
[info] Here are other dependency conflicts that were resolved:
[info]  * org.scala-lang.modules:scala-parser-combinators_2.12:1.0.5 is selected over 1.0.4
[info]      +- com.jsuereth:pgp-library_2.12:1.1.1                (depends on 1.0.5)
[info]      +- com.typesafe:ssl-config-core_2.12:0.2.2            (depends on 1.0.4)
[success] Total time: 11 s,2019 9:50:25 AM

(PS:返回主项目执行reload return命令).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读