我有多个项目A,B,C。有些是实用程序库,有些是应用程序。
如果我有依赖传家宝A->B->C,并且使用publish,我必须在A中同时包含依赖项B和C,即使A不直接使用来自C的任何东西(仅通过代理)。似乎所有的项目B依赖项都添加了提供的作用域。
为什么这些依赖项不会被解析并添加到类路径中呢?
这不是一个多项目的Build.scala (故意的),我有几个简化的构建文件,我希望它们是自我包含的构建。
在启动应用程序A时,我正在使用命令re (Revolver)。
/Magnus
本例中的示例配置必须包含多个库(bouncy城堡),这些库只在以下一个库中真正使用(所有库都与发布-本地发布)
"mollyware" %% "fulla-utils" % fulla,
"mollyware" %% "brage-http" % brage,
"mollyware" %% "saga-domain" % saga,级联build.sbt文件
scalaVersion := "2.10.3"
name := "mimer-idp"
organization := "mollyware"
version := "0.0.1"
import scalariform.formatter.preferences._
net.virtualvoid.sbt.graph.Plugin.graphSettings
// compile options
scalacOptions ++= Seq(
"-encoding",
"UTF-8",
"-optimise",
"-deprecation",
"-unchecked",
"-feature",
"-Yinline-warnings"
)
javacOptions ++= Seq(
"-Xlint:unchecked",
"-Xlint:deprecation"
)
resolvers += Classpaths.typesafeReleases
resolvers ++= Seq(
"Spray repo" at "http://repo.spray.io",
"Spray nightlies" at "http://nightlies.spray.io",
"Sonatype Snapshot Repo" at "http://oss.sonatype.org/content/repositories/snapshots/"
)
scalariformSettings
ScalariformKeys.preferences := FormattingPreferences()
.setPreference( RewriteArrowSymbols, true )
.setPreference( AlignParameters, true )
.setPreference( AlignSingleLineCaseStatements, true )
.setPreference( SpaceInsideParentheses, true )
.setPreference( DoubleIndentClassDeclaration, true )
.setPreference( PreserveDanglingCloseParenthesis, true )
libraryDependencies <<= scalaVersion { scala_version =>
val akka = "2.2.1"
val ampq = "1.3-SNAPSHOT"
val spray = "1.2.0"
val sprayJson = "1.2.5"
val fulla = "0.0.1"
val brage = "0.0.1"
val saga = "0.0.1"
val scalaTest = "2.0.RC2"
val commons = "1.7"
val bcastle = "1.49"
Seq(
"io.spray" % "spray-routing" % spray,
"io.spray" % "spray-can" % spray,
"io.spray" % "spray-http" % spray,
"io.spray" % "spray-client" % spray,
"io.spray" % "spray-testkit" % spray % "test",
"io.spray" %% "spray-json" % sprayJson,
"com.typesafe.akka" %% "akka-actor" % akka,
"com.typesafe.akka" %% "akka-remote" % akka,
"com.github.sstone" %% "amqp-client" % ampq,
"mollyware" %% "fulla-utils" % fulla,
"mollyware" %% "brage-http" % brage,
"mollyware" %% "saga-domain" % saga,
"commons-codec" % "commons-codec" % commons,
"org.scalatest" % "scalatest_2.10" % scalaTest % "test",
"org.bouncycastle" % "bcprov-jdk15on" % bcastle,
"org.bouncycastle" % "bcpkix-jdk15on" % bcastle
)
}
import sbtassembly.Plugin._
import AssemblyKeys._
import spray.revolver.RevolverPlugin._
assemblySettings
assembleArtifact in packageScala := false
assembleArtifact in packageDependency := true
assemblyOption in packageDependency ~= { _.copy(includeScala = false) }
Revolver.settings发布于 2013-12-08 20:27:20
这就是问题所在:在设置CI服务器时,我决定从构建版本中删除-SNAPSHOT。
这反过来似乎意味着发布本地版不会用相同的版本更新包。
我花了一段时间才弄明白,因为我不久前就做了这个改变。奇怪的是,代码似乎仍然被更新,因为我得到了类,没有发现异常。有可能是罐子被覆盖了,而不是常春藤或橡树吗?
我得到了依赖关系-图形插件的很好的帮助,最终解决了这个问题。没有列出依赖项。当我将版本或快照更改为快照时,它又开始工作了。
https://stackoverflow.com/questions/20405024
复制相似问题