2016-06-20 11 views
2

私はscala(sbt too)とhadoopをインストールする必要がある(アクティブな)gitプロジェクトをダウンロードしました。私が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 
関連する問題