我有一個單獨的Settings.scala
文件在我的大SBT項目,有以下幾點:「庫進行發佈未指定」,儘管發佈成功
lazy val commonSettings = Seq(
// ... lots of settings
publishTo :=
Some("Sonatype Nexus Repository Manager" at
"http://my.company.nexus/content/repositories/releases/"),
credentials += Credentials(Path.userHome/".ivy2"/".credentials"),
publishMavenStyle := true,
crossScalaVersions := Seq("2.10.6"),
// ... lots of other settings
)
現在build.sbt
我所有的項目都定義如下:
lazy val aProject =
project.in(file("somewhere/aProject")).
settings(commonSettings).
settings(
// project specific settings
)
當我現在做的
sbt "+ publish"
我本身Ë我所有的文物得以發表,當我看着我的Nexus他們在那裏,我也可以用它們作爲依賴等,所以出版的作品,但無論如何,我得到了在結束後:
java.lang.RuntimeException: Repository for publishing is not specified.
at scala.sys.package$.error(package.scala:27)
at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1470)
at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1470)
at scala.Option.getOrElse(Option.scala:120)
at sbt.Classpaths$.getPublishTo(Defaults.scala:1470)
at sbt.Classpaths$$anonfun$59.apply(Defaults.scala:1150)
at sbt.Classpaths$$anonfun$59.apply(Defaults.scala:1150)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
我在sbt文件中丟失/做錯了什麼?
好的,所以我必須定義一個根項目。現在我的項目有一大堆子項目。如何避免寫'lazy val root = project.in(file(「。」))。aggregate(project1,project2,project3,...,project739672)'?是否有「全部聚合」方法? – rabejens
我現在添加了一個根項目,並使用shell腳本構建了大型「聚合」。 – rabejens
對不起,我不知道。你應該把它作爲一個單獨的問題來提出。我已經添加了一個替代方案,不需要明確定義根項目,只要您想在其中應用默認設置即可。 –