Home > OS >  Why is there a sbt exception there, when I have added the folder with another git branch as a subfol
Why is there a sbt exception there, when I have added the folder with another git branch as a subfol

Time:01-23

In order to set up the project the same way as another project developer already has done, I do

  1. Clone the root project repo and switch/checkout the dev folder. It contains some project named core and deps in the corresponding folders.

build.sbt of this root contains mention on some sbt project among others:

lazy val industry = (project in file("industry"))

which isn't pointing to the actual folder inside the root folder

  1. Create the industry folder, cd to it, checkout the project again and switch/checkout to specific branch (say, industry-dev)

So now the mentioned project folder has the project itself, it hosts own build.sbt and other staff that exists in the corresponding folder. We have to set it up this way, as industry-dev is based on the classes from dev, that work as core classes and we need to observe them both the same time, not switching the single project from branch to branch

  1. In the root folder try to execute

    sbt core/clean

and I'm getting error with the message below:

[info] Loading settings for project spark-runner-build from plugins.sbt ...
[info] Loading project definition from D:\Java\sekai\spark-runner3\spark-runner\                                                                                                                                                                           project
[warn] There may be incompatibilities among your library dependencies; run 'evic                                                                                                                                                                           ted' to see detailed eviction warnings.
[info] Compiling 5 Scala sources to D:\Java\sekai\spark-runner3\spark-runner\pro                                                                                                                                                                           ject\target\scala-2.12\sbt-1.0\classes ...
[info] Done compiling.
D:\Java\sekai\spark-runner3\spark-runner\industry\build.sbt:53: error: missing ar                                                                                                                                                                           gument list for method environmentArtifactSettings in object Settings
Unapplied methods are only converted to functions when a function type is expect                                                                                                                                                                           ed.
You can make this conversion explicit by writing `environmentArtifactSettings _`                                                                                                                                                                            or `environmentArtifactSettings(_,_)` instead of `environmentArtifactSettings`.
    environmentArtifactSettings,
    ^
[error] sbt.compiler.EvalException: Type error in expression
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? l
[debug] > Exec(early(addDefaultCommands), None, None)
[debug] > Exec(addDefaultCommands, None, None)
[debug] > Exec(early(initialize), None, None)
[debug] > Exec(initialize, None, None)
[debug] > Exec(boot, None, None)
[debug] > Exec(writeSbtVersion, None, None)
[debug] > Exec(reload, None, None)
[debug] > Exec(sbtStashOnFailure, None, None)
[debug] > Exec(onFailure loadFailed, None, None)
[debug] > Exec(loadp, None, None)
[debug] Load.defaultLoad until apply took 240.9052ms
[debug]           Load.loadUnit: plugins took 62.3721ms
[debug]           Load.loadUnit: defsScala took 0.2643ms
[debug] [Loading] Scanning directory D:\Java\sekai\spark-runner3\spark-runner\pr                                                                                                                                                                           oject
[debug]             Load.loadUnit: mkEval took 6.0745ms
[debug] [Loading] Found non-root projects
[debug] [Loading] Done in D:\Java\sekai\spark-runner3\spark-runner\project, retu                                                                                                                                                                           rning: ()
[debug] deducing auto plugins based on known facts Set(Atom(sbt.plugins.CorePlug                                                                                                                                                                           in)) and clauses Clauses(List(Clause(Atom(sbt.plugins.JvmPlugin),Set(Atom(sbt.pl                                                                                                                                                                           ugins.IvyPlugin))), Clause(Atom(sbt.ScriptedPlugin),Set(Atom(sbt.plugins.JvmPlug                                                                                                                                                                           in))), Clause(Atom(sbt.plugins.SbtPlugin),Set(Atom(sbt.ScriptedPlugin))), Clause                                                                                                                                                                           (Atom(sbt.plugins.SemanticdbPlugin),Set(Atom(sbt.plugins.JvmPlugin))), Clause(At                                                                                                                                                                           om(sbt.plugins.JUnitXmlReportPlugin),Set(Atom(sbt.plugins.JvmPlugin))), Clause(A                                                                                                                                                                           tom(sbt.plugins.CorePlugin),Set(Atom(sbt.plugins.IvyPlugin))), Clause(Atom(sbt.p                                                                                                                                                                           lugins.IvyPlugin),Set(Atom(sbt.plugins.JvmPlugin))), Clause(Atom(sbt.plugins.Jvm                                                                                                                                                                           Plugin),Set(Atom(sbt.plugins.SemanticdbPlugin))), Clause(Atom(sbt.plugins.JvmPlu                                                                                                                                                                           gin),Set(Atom(sbt.plugins.JUnitXmlReportPlugin))), Clause(Atom(sbt.plugins.CoreP                                                                                                                                                                           lugin),Set(Atom(sbt.plugins.Giter8TemplatePlugin)))))
[debug]   :: deduced result: Matched(sbt.plugins.CorePlugin,sbt.plugins.Giter8Te                                                                                                                                                                           mplatePlugin,sbt.plugins.IvyPlugin,sbt.plugins.JvmPlugin,sbt.plugins.JUnitXmlRep                                                                                                                                                                           ortPlugin,sbt.plugins.SemanticdbPlugin)
[debug] Plugins.deducer#function took 12.2367 ms
[info] Loading settings for project spark-runner-build from plugins.sbt ...
[debug]               Load.resolveProject(spark-runner-build) took 186.0941ms
[debug]             Load.loadTransitive: finalizeProject2(Project(id spark-runne                                                                                                                                                                           r-build, base: D:\Java\sekai\spark-runner3\spark-runner\project, plugins: List(<                                                                                                                                                                           none>))) took 208.1284ms
[debug] [Loading] Done in D:\Java\sekai\spark-runner3\spark-runner\project, retu                                                                                                                                                                           rning: (spark-runner-build)
[debug]           Load.loadUnit: loadedProjectsRaw took 2876.5073ms
[debug]           Load.loadUnit: cleanEvalClasses took 6.6777ms
[debug]         Load.loadUnit(file:/D:/Java/sekai/spark-runner3/spark-runner/pro                                                                                                                                                                           ject/, ...) took 2950.8249ms
[debug]       Load.apply: load took 3424.9926ms
[debug]       Load.apply: resolveProjects took 4.7629ms
[debug]       Load.apply: finalTransforms took 35.1922ms
[debug]       Load.apply: config.delegates took 5.7578ms
[debug]       Load.apply: Def.make(settings)... took 321.9701ms
[debug]       Load.apply: structureIndex took 77.1997ms
[debug]       Load.apply: mkStreams took 2.3537ms
[info] Loading project definition from D:\Java\sekai\spark-runner3\spark-runner\                                                                                                                                                                           project
[debug] Running task... Cancel: Signal, check cycles: false, forcegc: true
[warn] There may be incompatibilities among your library dependencies; run 'evic                                                                                                                                                                           ted' to see detailed eviction warnings.
[info] Compiling 5 Scala sources to D:\Java\sekai\spark-runner3\spark-runner\pro                                                                                                                                                                           ject\target\scala-2.12\sbt-1.0\classes ...
[info] Done compiling.
[debug]     Load.loadUnit: plugins took 9147.8894ms
[debug]     Load.loadUnit: defsScala took 0.0045ms
[debug] [Loading] Scanning directory D:\Java\sekai\spark-runner3\spark-runner
[debug]       Load.loadUnit: mkEval took 0.2912ms
[debug] [Loading] Found non-root projects industry,industry_l,co                                                                                                                                                                           re,deps,standaloneBase,base
[debug] [Loading] Loading project industry @ D:\Java\sekai\spark-runner3\spark-ru                                                                                                                                                                           nner\industry
[debug] Type error in expression
[debug]         at sbt.compiler.Eval.checkError(Eval.scala:485)
[debug]         at sbt.compiler.Eval.compileAndLoad(Eval.scala:261)
[debug]         at sbt.compiler.Eval.evalCommon(Eval.scala:222)
[debug]         at sbt.compiler.Eval.evalDefinitions(Eval.scala:164)
[debug]         at sbt.internal.EvaluateConfigurations$.evaluateDefinitions(Eval                                                                                                                                                                           uateConfigurations.scala:325)
[debug]         at sbt.internal.EvaluateConfigurations$.evaluateSbtFile(Evaluate                                                                                                                                                                           Configurations.scala:151)
[debug]         at sbt.internal.Load$.loadSettingsFile$1(Load.scala:1128)
[debug]         at sbt.internal.Load$.$anonfun$discoverProjects$2(Load.scala:113                                                                                                                                                                           8)
[debug]         at scala.collection.MapLike.getOrElse(MapLike.scala:131)
[debug]         at scala.collection.MapLike.getOrElse$(MapLike.scala:129)
[debug]         at scala.collection.AbstractMap.getOrElse(Map.scala:63)
[debug]         at sbt.internal.Load$.memoLoadSettingsFile$1(Load.scala:1137)
[debug]         at sbt.internal.Load$.$anonfun$discoverProjects$4(Load.scala:114                                                                                                                                                                           5)
[debug]         at scala.collection.TraversableLike.$anonfun$map$1(TraversableLi                                                                                                                                                                           ke.scala:238)
[debug]         at scala.collection.immutable.List.foreach(List.scala:392)
[debug]         at scala.collection.TraversableLike.map(TraversableLike.scala:23                                                                                                                                                                           8)
[debug]         at scala.collection.TraversableLike.map$(TraversableLike.scala:2                                                                                                                                                                           31)
[debug]         at scala.collection.immutable.List.map(List.scala:298)
[debug]         at sbt.internal.Load$.loadFiles$1(Load.scala:1145)
[debug]         at sbt.internal.Load$.discoverProjects(Load.scala:1159)
[debug]         at sbt.internal.Load$.discover$1(Load.scala:855)
[debug]         at sbt.internal.Load$.discoverAndLoad$1(Load.scala:890)
[debug]         at sbt.internal.Load$.loadTransitive(Load.scala:908)
[debug]         at sbt.internal.Load$.loadTransitive(Load.scala:971)
[debug]         at sbt.internal.Load$.loadProjects$1(Load.scala:720)
[debug]         at sbt.internal.Load$.$anonfun$loadUnit$11(Load.scala:723)
[debug]         at sbt.internal.Load$.timed(Load.scala:1390)
[debug]         at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:723)
[debug]         at sbt.internal.Load$.timed(Load.scala:1390)
[debug]         at sbt.internal.Load$.loadUnit(Load.scala:682)
[debug]         at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:480)
[debug]         at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoa                                                                                                                                                                           der.scala:180)
[debug]         at sbt.internal.BuildLoader.apply(BuildLoader.scala:245)
[debug]         at sbt.internal.Load$.loadURI$1(Load.scala:542)
[debug]         at sbt.internal.Load$.loadAll(Load.scala:558)
[debug]         at sbt.internal.Load$.loadURI(Load.scala:488)
[debug]         at sbt.internal.Load$.load(Load.scala:467)
[debug]         at sbt.internal.Load$.$anonfun$apply$1(Load.scala:243)
[debug]         at sbt.internal.Load$.timed(Load.scala:1390)
[debug]         at sbt.internal.Load$.apply(Load.scala:243)
[debug]         at sbt.internal.Load$.defaultLoad(Load.scala:55)
[debug]         at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:839)
[debug]         at sbt.BuiltinCommands$.doLoadProject(Main.scala:839)
[debug]         at sbt.BuiltinCommands$.$anonfun$loadProjectImpl$2(Main.scala:80                                                                                                                                                                           1)
[debug]         at sbt.Command$.$anonfun$applyEffect$4(Command.scala:149)
[debug]         at sbt.Command$.$anonfun$applyEffect$2(Command.scala:144)
[debug]         at sbt.Command$.process(Command.scala:187)
[debug]         at sbt.MainLoop$.process$1(MainLoop.scala:185)
[debug]         at sbt.MainLoop$.processCommand(MainLoop.scala:220)
[debug]         at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:142)
[debug]         at sbt.State$StateOpsImpl$.runCmd$1(State.scala:273)
[debug]         at sbt.State$StateOpsImpl$.process$extension(State.scala:277)
[debug]         at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:142)
[debug]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.sc                                                                                                                                                                           ala:19)
[debug]         at sbt.MainLoop$.next(MainLoop.scala:142)
[debug]         at sbt.MainLoop$.run(MainLoop.scala:133)
[debug]         at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:111)
[debug]         at sbt.io.Using.apply(Using.scala:27)
[debug]         at sbt.MainLoop$.runWithNewLog(MainLoop.scala:105)
[debug]         at sbt.MainLoop$.runAndClearLast(MainLoop.scala:60)
[debug]         at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:45)
[debug]         at sbt.MainLoop$.runLogged(MainLoop.scala:36)
[debug]         at sbt.StandardMain$.runManaged(Main.scala:132)
[debug]         at sbt.xMain$.run(Main.scala:67)
[debug]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[debug]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces                                                                                                                                                                           sorImpl.java:62)
[debug]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet                                                                                                                                                                           hodAccessorImpl.java:43)
[debug]         at java.lang.reflect.Method.invoke(Method.java:497)
[debug]         at sbt.internal.XMainConfiguration.run(XMainConfiguration.scala:                                                                                                                                                                           46)
[debug]         at sbt.xMain.run(Main.scala:39)
[debug]         at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
[debug]         at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
[debug]         at xsbt.boot.Launch$.run(Launch.scala:149)
[debug]         at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
[debug]         at xsbt.boot.Launch$.launch(Launch.scala:159)
[debug]         at xsbt.boot.Launch$.apply(Launch.scala:44)
[debug]         at xsbt.boot.Launch$.apply(Launch.scala:21)
[debug]         at xsbt.boot.Boot$.runImpl(Boot.scala:78)
[debug]         at xsbt.boot.Boot$.run(Boot.scala:73)
[debug]         at xsbt.boot.Boot$.main(Boot.scala:21)
[debug]         at xsbt.boot.Boot.main(Boot.scala)
[error] sbt.compiler.EvalException: Type error in expression
[error] sbt.compiler.EvalException: Type error in expression
[error] Use 'last' for the full log.
[debug] > Exec(loadFailed, None, None)
[debug] > Exec(last, None, None)
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

What would be the core problem there?


CodePudding user response:

The reason for this exception was the misusage of the branches, each of them contained the expected build.sbt. In fact the subfolder branch was the ame as the roo so the subproject build.sbt was in fact the same as the root project build.sbt

So if you face that, please check is the code of the sub projet what you are expecting.

  •  Tags:  
  • Related