SBT not resolving transitive dependencies in the <Profile> section of POM

不羁岁月 提交于 2019-12-05 14:22:51

sbt does not handle maven profiles. You should add the dependencies (mentioned in given profile) to your sbt file.

name := "StreamMaker"

version := "1.0"

scalaVersion := "2.10.4"

resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"

libraryDependencies += "org.apache.hbase" % "hbase-client" % "0.98.0-hadoop2" 

// Add the dependencies from the active profile.
libraryDependencies ++= Seq("org.apache.hadoop" % "hadoop-mapreduce-client-core" % "2.2.0",
                            "org.apache.hadoop" % "hadoop-mapreduce-client-jobclient" % "2.2.0",
                            "org.apache.hadoop" % "hadoop-hdfs" % "2.2.0",
                            "org.apache.hadoop" % "hadoop-auth" % "2.2.0",
                            "org.apache.hadoop" % "hadoop-common" % "2.2.0",
                            "org.apache.hadoop" % "hadoop-client" % "2.2.0",
                            "org.apache.hadoop" % "hadoop-annotations" % "2.2.0")

net.virtualvoid.sbt.graph.Plugin.graphSettings

See this discussion.

Quoting Josh:

Maven does allow this, but it's kind of bad form. How do you know which profile was active for deployment? Changing dependencies based on active profiles is VERY evil to your users. I'd contact that authors of the project and ask them to find an alternative method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!