多项目构建-全局插件在构建过程中重新编译,但在“上失败”;符号';键入sbt.io.IOSyntax';“类路径中缺少”;

多项目构建-全局插件在构建过程中重新编译,但在“上失败”;符号';键入sbt.io.IOSyntax';“类路径中缺少”;,sbt,Sbt,sbt版本:从1.4.0到1.4.2 以前在1.3.13上工作 多项目构建,一个简单的最低版本示例项目可在 在sbt样本中启动sbt时,sbt加载失败,出现错误 构建的简短描述: 我们的项目有一个全局插件,保存所有组织设置,还有一个单独的插件项目,保存特定于我们一些项目的设置。特定的设置项目依赖于全局插件项目将全局自动插件添加到特定自动插件的需求中 需要使用特定插件的项目将把特定插件项目作为项目依赖项拉入其构建项目(在project/plugin.sbt中),如下面的结构所示 -+-- glob

sbt版本:从1.4.0到1.4.2

以前在1.3.13上工作

多项目构建,一个简单的最低版本示例项目可在

在sbt样本中启动sbt时,sbt加载失败,出现错误

构建的简短描述:

我们的项目有一个全局插件,保存所有组织设置,还有一个单独的插件项目,保存特定于我们一些项目的设置。特定的设置项目依赖于全局插件项目将全局自动插件添加到特定自动插件的需求中

需要使用特定插件的项目将把特定插件项目作为项目依赖项拉入其构建项目(在project/plugin.sbt中),如下面的结构所示

-+-- global-plugin - used as sample project when running sbt
 |
 +-- specific-plugin - dependsOn global-plugin
 |
 +-- sbt-sample - dependsOn sbt-sample-child and sbt-sample-other-child
 |     +-- sbt-sample-build - dependsOn specific-plugin
 |
 +-- sbt-sample-child
 |     +-- sbt-sample-child-build - dependsOn specific-plugin
 |
 +-- sbt-sample-other-child (not included in linked project above as unecessary to reproduce this error)
       +-- sbt-sample-other-child-build
使用上述设置,在sbt示例目录中使用以下命令运行sbt时:

SBT_OPTS="${SBT_OPTS} -Dsbt.global.plugins=Path\to\repo\sample\plugin-sample" sbt
  
结果如下所示:

[info] welcome to sbt 1.4.2 (AdoptOpenJDK Java 11.0.8)
[info] loading global plugins from O:\Prj\github\sample\global-plugin\project
[info] loading settings for project global-plugins from build.sbt ...
[info] loading global plugins from O:\Prj\github\sample\global-plugin
[info] compiling 3 Scala sources to O:\Prj\github\sample\global-plugin\target\scala-2.12\sbt-1.0\classes ...
[info] loading settings for project sample-build from plugins.sbt ...
[info] loading project definition from O:\Prj\github\sample\specific-plugin\project
[info] loading settings for project play-plugins from build.sbt ...
[info] loading project definition from O:\Prj\github\sample\global-plugin\project
[info] loading settings for project global-plugin from build.sbt ...
[info] loading project definition from O:\Prj\github\sample\sbt-sample\project
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] compiling 3 Scala sources to O:\Prj\github\sample\global-plugin\target\scala-2.12\sbt-1.0\classes ...
[info] loading settings for project sbt-sample from build.sbt ...
[info] loading settings for project sbt-sample-child-build from plugins.sbt ...
[info] loading project definition from O:\Prj\github\sample\specific-plugin\project
[info] loading settings for project play-plugins from build.sbt ...
[info] loading project definition from O:\Prj\github\sample\global-plugin\project
[info] loading settings for project global-plugin from build.sbt ...
[info] loading project definition from O:\Prj\github\sample\sbt-sample-child\project
[info] compiling 3 Scala sources to O:\Prj\github\sample\global-plugin\target\scala-2.12\sbt-1.0\classes ...
[error] O:\Prj\github\sample\global-plugin\src\main\scala\iad\sbt\Projects.scala:4:8: Symbol 'type sbt.io.IOSyntax' is missing from the classpath.
[error] This symbol is required by 'trait sbt.IOSyntax1'.
[error] Make sure that type IOSyntax is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
[error] A full rebuild may help if 'IOSyntax1.class' was compiled against an incompatible version of sbt.io.
[error] import sbt._
[error]        ^
[error] one error found
[error] (ProjectRef(uri("file:///O:/Prj/github/sample/global-plugin/"), "global-plugin") / Compile / compileIncremental) Compilation failed
[warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)

有人知道是什么原因导致全局插件重新编译并在重新编译过程中失败,即使它在第一次编译时就完成得很好吗?

sbt 1.4.3(最新版本)可能已经解决了您的问题。

确实解决了这个问题。谢谢