為了像另一個專案開發人員已經完成的那樣設定專案,我這樣做了
- 克隆根專案 repo 并切換/簽出 dev 檔案夾。它在相應的檔案夾中包含一些名為 core 和 deps 的專案。
build.sbt 這個根目錄包含一些 sbt 專案中的提及:
lazy val industry = (project in file("industry"))
它沒有指向根檔案夾中的實際檔案夾
- 創建
industry檔案夾, cd 到它,再次簽出專案并切換/簽出到特定分支(例如,industry-dev)
所以現在提到的專案檔案夾有專案本身,它托管build.sbt了相應檔案夾中存在的自己和其他員工。我們必須以這種方式設定它,就像industry-dev基于來自的類一樣dev,它們作為核心類作業,我們需要同時觀察它們,而不是將單個專案從一個分支切換到另一個分支
在根檔案夾中嘗試執行
sbt 核心/清潔
我收到以下訊息的錯誤:
[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?
那里的核心問題是什么?
uj5u.com熱心網友回復:
這個例外的原因是誤用了分支,每個分支都包含預期的 build.sbt。事實上,子檔案夾分支與 roo 相同,因此子專案 build.sbt 實際上與根專案 build.sbt 相同
因此,如果您遇到這種情況,請檢查您所期望的子專案的代碼。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/419592.html
標籤:
