0

I am using breeze-viz 0.3, but need to use newer version of jfreechart. According to the dependency table https://mvnrepository.com/artifact/org.scalanlp/breeze-viz_2.10/0.3

jfreechart 1.0.13 is the default, but 1,0.19 is the updated version, which is the one I want. I added the lines

dependencyOverrides ++= Set(
    "org.jfree" % "jfreechart" % "1.0.19"
)

and re-run sbt eclipse, but still I have jfreedchart 1.0.13 in the project. How do I force it to use 1.0.19?

Here is the entire build.sbt

import AssemblyKeys._

name := "Simple Bayesian"

lazy val commonSettings = Seq(
  version := "1.0",
  organization := "com.myco",
  scalaVersion := "2.10.4"
)

val sparkVersion = "2.0.0"
val hbaseVersion = "1.0.0"
val hadoopVersion = "2.4.0"
val sprayVersion      = "1.3.2"

lazy val app = (project in file("."))
  .settings(commonSettings: _*)
  .settings(
    // your settings here
  )

libraryDependencies <<= scalaVersion {
  scala_version => Seq(
    // Spark and Spark Streaming
    "org.apache.spark" %% "spark-core" % sparkVersion,
    "org.apache.spark" %% "spark-mllib" % sparkVersion,
    "org.apache.spark" %% "spark-streaming" % sparkVersion,
    "org.apache.spark" %% "spark-streaming-kinesis-asl" % sparkVersion,
    //"org.scalanlp" %% "breeze" % "0.12",
    //"org.scalanlp" %% "breeze-natives" % "0.12",
    "org.scalanlp" %% "breeze-viz" % "0.3",
    "org.apache.commons" % "commons-lang3" % "3.3.2",  
    "org.apache.commons" % "commons-math3" %"3.2",
    "org.apache.spark" %% "spark-hive" % sparkVersion,
    "commons-lang" % "commons-lang" % "2.6",
    "com.amazonaws" % "aws-java-sdk" % "1.0.002" excludeAll(ExclusionRule(organization = "javax.servlet")),
    "org.json4s" %% "json4s-jackson" % "3.2.10",
    "org.json4s" %% "json4s-native" % "3.2.10",
    "com.amazonaws" % "amazon-kinesis-client" % "1.3.0",
    "com.amazonaws" % "aws-java-sdk" % "1.9.13",
    //"net.sf.opencsv" % "opencsv" % "2.3",
    "log4j" % "log4j" % "1.2.17",
    "io.spray"          %% "spray-json"      % sprayVersion,
    //"gov.sandia.foundry" % "cognitive-foundry" % "3.4.3",
    //"cc.mallet" % "mallet" % "2.0.8",
    "com.github.scopt" %% "scopt" % "3.2.0"% "provided",
    "com.github.kindlychung" % "sfreechart" % "0.1.2", 
    //"ca.umontreal.iro" % "ssj" % "2.5",
    "joda-time" % "joda-time" % "2.3"
  )
}

libraryDependencies += "org.jfree" % "jfreechart" % "1.0.19"

libraryDependencies += "org.biojava" % "jcolorbrewer" % "5.2"

dependencyOverrides ++= Set(
//  "com.fasterxml.jackson.core" % "jackson-databind" % "2.4.4"
    "org.jfree" % "jfreechart" % "1.0.19",
    "org.biojava" % "jcolorbrewer" % "5.2"
)

resolvers += "typesafe repo" at " http://repo.typesafe.com/typesafe/releases/"
resolvers += "jitpack" at "https://jitpack.io"

EclipseKeys.withSource := true

I had trouble with scala 2.11 before. Should I update to 2.11 now?

bhomass
  • 3,414
  • 8
  • 45
  • 75

1 Answers1

1

You see jfreedchart 1.0.13, but it's another one. If you will have a look onto dependency graph for viz, you will see, that it depends on "jfree" % "jfreechart" % "1.0.13", while you want to use "org.jfree" % "jfreechart" % "1.0.19", which doesn't intersect with the previous one, since they have different groupId. So, you need to add

libraryDependencies += "org.jfree" % "jfreechart" % "1.0.19"

and exclude transitive dependencies from the viz, that are repeating in your classpath, by doing this:

libraryDependencies += "org.scalanlp" % "breeze-viz_2.10" % "0.3"  exclude("jfree", "jfreechart") exclude("jfree", "jcommon")

Caveat, this could lead to the problems, if the 1.0.19 is not backward compatible with 1.0.13

Mysterion
  • 9,050
  • 3
  • 30
  • 52
  • You are totally right. the 1.0.13 has the group name "jfree", but 1.0.19 is still listed as the update. How can that be? that a lib with a different group name is given as the updated version? In any case, the two versions have the same class name, and if I have both, there will be conflicts in the project still. – bhomass Feb 14 '17 at 18:07
  • I have tried having both, and the version conflict still exists, as I expected. – bhomass Feb 14 '17 at 18:57
  • That is indeed the way to fix it. I am wondering, what if there were the default and updated version have the same group id, which is usually the case. The exclude method would, I think, not apply. In that case, how would you force it to get the updated version? – bhomass Feb 21 '17 at 00:23