2016-06-20 2 views
2

Я загрузил (активный) проект git, который требует от меня установки scala (sbt too) и hadoop. Когда я пытаюсь построить его через sbt (сборка sbt), он генерирует массу предупреждений о непереходных зависимостях. Я пытался связаться с поставщиками проекта, но они не дают мне правильных ответов; просто сказал мне, что он работает на своих машинах.Непереходные зависимости с узлом sbt

Когда я пытаюсь «сборку SBT» я получаю:

[info] Resolving jline#jline;2.12 ... 
[info] Done updating. 
[warn] Found intransitive dependency (org.apache.hadoop:hadoop-common:2.6.0) while publishMavenStyle is true, but Maven repositories 
[warn] do not support intransitive dependencies. Use exclusions instead so transitive dependencies 
[warn] will be correctly excluded in dependent projects. 
[warn]    
[warn] Found intransitive dependency (org.apache.hadoop:hadoop-mapreduce-client-core:2.6.0) while publishMavenStyle is true, but Maven repositories 
[warn] do not support intransitive dependencies. Use exclusions instead so transitive dependencies 
[warn] will be correctly excluded in dependent projects. 
[warn]    
[warn] Found intransitive dependency (org.apache.hadoop:hadoop-mapreduce-client-common:2.6.0) while publishMavenStyle is true, but Maven repositories 
[warn] do not support intransitive dependencies. Use exclusions instead so transitive dependencies 
[warn] will be correctly excluded in dependent projects. 
[warn]    
[warn] Found intransitive dependency (org.apache.hadoop:hadoop-annotations:2.6.0) while publishMavenStyle is true, but Maven repositories 
[warn] do not support intransitive dependencies. Use exclusions instead so transitive dependencies 
[warn] will be correctly excluded in dependent projects. 
[warn]    
[warn] Found intransitive dependency (org.apache.hadoop:hadoop-auth:2.6.0) while publishMavenStyle is true, but Maven repositories 
[warn] do not support intransitive dependencies. Use exclusions instead so transitive dependencies 
[warn] will be correctly excluded in dependent projects. 
[warn]    
[warn] Found intransitive dependency (org.apache.hadoop:hadoop-yarn-common:2.6.0) while publishMavenStyle is true, but Maven repositories 
[warn] do not support intransitive dependencies. Use exclusions instead so transitive dependencies 
[warn] will be correctly excluded in dependent projects. 
[warn]    
[warn] Found intransitive dependency (org.apache.hbase:hbase-server:0.96.2-hadoop2) while publishMavenStyle is true, but Maven repositories 
[warn] do not support intransitive dependencies. Use exclusions instead so transitive dependencies 
[warn] will be correctly excluded in dependent projects ... 

И есть build.sbt файл, который содержит все зависимости, по проекту:

libraryDependencies ++= Seq(
      "com.beust" % "jcommander" % "1.35", 
      "org.apache.hadoop" % "hadoop-common" % "2.6.0" intransitive(), 
      "org.apache.hadoop" % "hadoop-mapreduce-client-core" % "2.6.0" intransitive(), 
      "org.apache.hadoop" % "hadoop-mapreduce-client-common" % "2.6.0" intransitive(), 
      "org.apache.hadoop" % "hadoop-annotations" % "2.6.0" intransitive(), 
      "org.apache.hadoop" % "hadoop-auth" % "2.6.0" intransitive(), 
      "org.apache.hadoop" % "hadoop-yarn-common" % "2.6.0" intransitive(), 
      "org.apache.hadoop" % "hadoop-yarn-api" % "2.6.0", 
      "org.apache.hbase" % "hbase-server" % "0.96.2-hadoop2" intransitive(), 
      "org.apache.hbase" % "hbase-common" % "0.96.2-hadoop2" intransitive(), 
      "org.apache.hbase" % "hbase-client" % "0.96.2-hadoop2" intransitive(), 
      "org.apache.hbase" % "hbase-protocol" % "0.96.2-hadoop2", 
      "org.cloudera.htrace" % "htrace-core" % "2.04" intransitive(), 
      "commons-configuration" % "commons-configuration" % "1.6" exclude("commons-beanutils", "commons-beanutils-core"), 
      "commons-httpclient" % "commons-httpclient" % "3.1", 
      "commons-io" % "commons-io" % "2.4", 
      "com.google.guava" % "guava" % "11.0.2", 
      "log4j" % "log4j" % "1.2.16", 
      "org.slf4j" % "slf4j-log4j12" % "1.7.5", 
      "org.codehaus.jackson" % "jackson-jaxrs" % "1.9.13", 
      "org.apache.avro" % "avro" % "1.7.4", 
      "junit" % "junit" % "4.11" % "it,test", 
      "com.novocode" % "junit-interface" % "0.10" % "it,test", 
      "com.jsuereth" % "scala-arm_2.11" % "1.4" % "it,test", 
      "org.scalatest" % "scalatest_2.11" % "2.2.1" % "it,test" 
      ) 

assemblyMergeStrategy in assembly := { 
    case PathList("org", "apache", "hadoop", "yarn", xs @ _*) => MergeStrategy.first 
    case x => val oldStrategy = (assemblyMergeStrategy in assembly).value 
    oldStrategy(x) 
} 

assemblyExcludedJars in assembly := { 
    val cp = (fullClasspath in assembly).value 
    cp filter {_.data.getName == "commons-beanutils-1.7.0.jar"} 
} 

scalaVersion := "2.11.4" 

// output jar is here: target/ruleXtract.jar 
assemblyOutputPath in assembly := file("target/ruleXtract.jar") 

// we want a jar without a main class so we can run it as "hadoop jar class args" 
mainClass in (Compile, packageBin) := None 

Что я должен делать в чтобы заставить его работать? Я не знаю, как построить этот проект без «сборки sbt». Я проверил несколько руководств по sbt, и build.sbt кажется прекрасным - хотя и не совсем уверенным. В чем проблема? У вас есть предложения по его решению?

B.R.

+0

Почему SBT сборки? Вы пробовали пакет sbt? – LynxZh

+0

Потому что в инструкциях учебника было написано 'sbt assembly'. Кстати, по-прежнему дает мне тот же список ошибок. –

ответ

2

Это может не решить вашу проблему, но это избавит вас от предупреждений. Свойство SBT «publishMavenStyle» используется, когда вы хотите опубликовать свой проект в репозитории Maven (http://xerial.org/blog/2014/03/24/sbt/). Если вы не планируете публикацию, вы можете установить значение false.

Если вы используете несколько файлов build.sbt, вы можете установить его в качестве такового, который установит его для всего проекта:

publishMavenStyle in ThisBuild := false 
Смежные вопросы