1) Clone PredictionIO ; cd to folder and run: ./make-distribution.sh -Dscala.version=2.11.8 -Dspark.version=2.1.0 -Delasticsearch.version=1.7.5
3) Clone Uniiversal Recommender; cd to folder; create lib folder; copy mahout jars created at step 2 to UR lib folder;
4) On same folder, mkdir -p src/main/scala/com/actionml/; cp scr/main/scala/* src/main/scala/com/actionml # Move files to STANDART java structure.
import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
name := "universal-recommender"
version := "0.6.0"
scalaVersion := "2.11.8"
//autoScalaLibrary := false
organization := "com.actionml"
val mahoutVersion = "0.13.1"
val pioVersion = "0.12.0-incubating"
val elasticsearch1Version = "1.7.5"
//val elasticsearch5Version = "5.1.2"
unmanagedJars in Compile ++=
(file("file:///ur_folder/lib/") * "*.jar").classpath
libraryDependencies ++= Seq(
"org.apache.predictionio" % "apache-predictionio-core_2.11" % "0.12.0-incubating" % "provided" from "file:///ur_folder/lib/pio-assembly-0.12.0-incubating.jar",
"org.apache.predictionio" % "apache-predictionio-data-elasticsearch1_2.11" % "0.11.0-incubating" % "provided",
"org.apache.spark" %% "spark-core" % "2.1.0" % "provided",
"org.apache.spark" %% "spark-mllib" % "2.1.0" % "provided",
"org.xerial.snappy" % "snappy-java" % "1.1.1.7",
// Mahout's Spark libs
"it.unimi.dsi" % "fastutil" % "7.0.12",
"org.apache.commons" % "commons-math3" % "3.2",
"com.tdunning" % "t-digest" % "3.1",
"org.apache.mahout" % "mahout-math" % mahoutVersion from "file:///ur_folder/lib/libs/mahout-math-0.13.1-SNAPSHOT.jar",
"org.apache.mahout" % "mahout-math-scala_2.11" % mahoutVersion from "file:///ur_folder/lib/mahout-math-scala_2.11-0.13.1-SNAPSHOT.jar",
"org.apache.mahout" % "mahout-spark_2.11" % mahoutVersion
exclude("org.apache.spark", "spark-core_2.11") from "file:///ur_folder/lib/mahout-spark_2.11-0.13.1-SNAPSHOT-spark_2.1.jar",
"org.apache.mahout" % "mahout-math" % mahoutVersion from "file:///ur_folder/lib/mahout-math-0.13.1-SNAPSHOT.jar",
"org.apache.mahout" % "mahout-hdfs" % mahoutVersion
exclude("com.thoughtworks.xstream", "xstream")
exclude("org.apache.hadoop", "hadoop-client") from "file:///ur_folder/lib/mahout-hdfs-0.13.1-SNAPSHOT.jar",
//"org.apache.hbase" % "hbase-client" % "0.98.5-hadoop2" % "provided",
// exclude("org.apache.zookeeper", "zookeeper"),
// other external libs
"com.thoughtworks.xstream" % "xstream" % "1.4.4"
exclude("xmlpull", "xmlpull"),
// possible build for es5
//"org.elasticsearch" %% "elasticsearch-spark-13" % elasticsearch5Version % "provided",
"org.elasticsearch" % "elasticsearch" % "1.7.5",
"org.elasticsearch" % "elasticsearch-spark-20_2.11" % "5.4.1"
exclude("org.apache.spark", "spark-core_2.11"),
"org.json4s" %% "json4s-native" % "3.2.10",
"org.apache.lucene" % "lucene-core" % "4.10.4" )
resolvers += Resolver.mavenLocal
SbtScalariform.scalariformSettings
libraryDependencies ~= { _ map {
case m if m.organization == "org.elasticsearch" =>
m.exclude("org.elasticsearch.hadoop", "org.elasticsearch.hadoop")
case m => m
}}
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(DanglingCloseParenthesis, Prevent)
.setPreference(MultilineScaladocCommentsStartOnFirstLine, true)
assemblyMergeStrategy in assembly := {
case PathList("apache", "lucene-core", "util") => MergeStrategy.concat
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case x => MergeStrategy.first
}