Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

addSbtPlugin(...) cause eviction warning but 'evicted' command shows nothing

Tags:

scala

sbt

With sbt 1.2.7 and sbt-pgp plugin, sbt shows eviction warning.

$ 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

However, evicted command shows nothing.

$ 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

Additional Info

  1. With sbt 1.1.6, no warnings
  2. With sbt 1.2.0, warning occured
  3. With sbt-sonatype, no warnings
  4. With sbt-native-packager, warning occured

Therefore, this warning must happens with specific plugin and sbt 1.2.0 or higher.

source to reproduce: https://github.com/bigwheel/sbt-unknown-evicted-warning

Why the warning shows ? and how to resolve this message ?

like image 641
bigwheel Avatar asked Jan 05 '19 05:01

bigwheel


1 Answers

Remember that SBT is recuersive - that means, SBT uses SBT to build the SBT used to build your project.

The eviction warning you are seeing is not for your main project, but for the meta-project!
You can check that by running the evicted command in the meta project using the reload plugins command.
(I will be using sbt as shell instead of as a batch command executor, which is better and faster for development).

$ 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, completed Jan 5, 2019 9:50:25 AM

(PS: To return to the main project execute the reload return command).

like image 59
Luis Miguel Mejía Suárez Avatar answered Nov 11 '22 03:11

Luis Miguel Mejía Suárez