-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
108 lines (92 loc) · 3.56 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import java.io.{File, FileOutputStream}
import java.nio.file.{Files, Paths}
import sbtassembly.MergeStrategy
import sbtassembly.MergeStrategy.createMergeTarget
import scala.collection.mutable
name := "jaiPackagingProblems"
organization := "imagio"
scalaVersion := "2.11.8"
scalacOptions ++= Seq(
"-target:jvm-1.8",
"-encoding", "UTF-8",
"-unchecked",
"-deprecation",
"-feature",
"-Xfuture",
"-Xlint:missing-interpolator",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Ywarn-dead-code",
"-Ywarn-unused"
)
fork := true
lazy val spark = "2.1.1"
lazy val geotools = "17.1"
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
resolvers += "osgeo" at "http://download.osgeo.org/webdav/geotools"
resolvers += "boundless" at "http://repo.boundlessgeo.com/main"
resolvers += "imageio" at "http://maven.geo-solutions.it"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % spark % "provided",
"org.apache.spark" %% "spark-sql" % spark % "provided",
"org.apache.spark" %% "spark-hive" % spark % "provided")
.map(_.excludeAll(
ExclusionRule(organization = "org.scalacheck"),
ExclusionRule(organization = "org.scalactic"),
ExclusionRule(organization = "org.scalatest")
))
libraryDependencies ++= Seq(
"org.geotools" % "gt-main" % geotools,
"org.geotools" % "gt-arcgrid" % geotools,
"org.geotools" % "gt-process-raster" % geotools)
.map(_.excludeAll(
ExclusionRule(organization = "com.vividsolutions")
))
// show sbt evicted
libraryDependencies ++= Seq(
"org.datasyslab" % "geospark" % "0.7.0",
"org.datasyslab" % "babylon" % "0.2.0"
).map(_.excludeAll(
ExclusionRule(organization = "org.geotools", artifact = "gt-main")
))
libraryDependencies ++= Seq(
"com.oracle" % "ojdbc8" % "12.2.0.1",
"com.holdenkarau" % "spark-testing-base_2.11" % s"2.1.0_0.6.0" % "test"
)
run in Compile := Defaults.runTask(fullClasspath in Compile, mainClass.in(Compile, run), runner.in(Compile, run)).evaluated
assemblyMergeStrategy in assembly := {
// http://stackoverflow.com/questions/43910006/geotools-jai-fatjar-causing-problems-in-native-dependencies
case PathList("org", "datasyslab", ps@_*) if ps.contains("showcase") => MergeStrategy.discard
case PathList("META-INF", xs@_*) =>
xs match {
case ("MANIFEST.MF" :: Nil) => MergeStrategy.discard
case ("NOTICE.txt" :: Nil) => MergeStrategy.discard
case ("LICENSE.txt" :: Nil) => MergeStrategy.discard
case ("NOTES.txt" :: Nil) => MergeStrategy.discard
// Concatenate everything in the services directory to keep GeoTools happy.
case ("services" :: _ :: Nil) =>
MergeStrategy.concat
// Concatenate these to keep JAI happy.
case ("javax.media.jai.registryFile.jai" :: Nil) | ("registryFile.jai" :: Nil) | ("registryFile.jaiext" :: Nil) =>
MergeStrategy.concat
case (name :: Nil) => {
// Must exclude META-INF/*.([RD]SA|SF) to avoid "Invalid signature file digest for Manifest main attributes" exception.
if (name.endsWith(".RSA") || name.endsWith(".DSA") || name.endsWith(".SF")) {
MergeStrategy.discard
}
else {
MergeStrategy.deduplicate
}
}
// TODO get rid of merge first and find proper strategy which works
case _ => MergeStrategy.first
}
case _ => MergeStrategy.first
}
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("com.google.**" -> "shadedguava.@1").inAll
)
test in assembly := {}
mainClass := Some("geo.JAIParsingProblemLocalFine")