-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathbuild.sbt
108 lines (97 loc) · 3.69 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 sbtrelease.Version
parallelExecution in ThisBuild := false
val kafkaVersion = "2.0.0"
val confluentVersion = "5.0.0"
val akkaVersion = "2.5.14"
lazy val commonSettings = Seq(
organization := "net.manub",
scalaVersion := "2.12.6",
crossScalaVersions := Seq("2.12.6", "2.11.12"),
homepage := Some(url("https://github.com/manub/scalatest-embedded-kafka")),
parallelExecution in Test := false,
logBuffered in Test := false,
fork in Test := true,
javaOptions ++= Seq("-Xms512m", "-Xmx2048m"),
scalacOptions += "-deprecation",
scalafmtOnCompile := true
)
lazy val commonLibrarySettings = libraryDependencies ++= Seq(
"org.apache.avro" % "avro" % "1.8.2",
"org.apache.kafka" %% "kafka" % kafkaVersion,
"org.slf4j" % "slf4j-log4j12" % "1.7.25" % Test,
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"com.typesafe.akka" %% "akka-actor" % akkaVersion % Test,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test
)
lazy val publishSettings = Seq(
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
},
pomExtra :=
<scm>
<url>https://github.com/manub/scalatest-embedded-kafka</url>
<connection>scm:git:[email protected]:manub/scalatest-embedded-kafka.git</connection>
</scm>
<developers>
<developer>
<id>manub</id>
<name>Emanuele Blanco</name>
<url>http://twitter.com/manub</url>
</developer>
</developers>
)
lazy val releaseSettings = Seq(
releaseVersionBump := Version.Bump.Minor,
releaseCrossBuild := true
)
// https://github.com/sbt/sbt/issues/3618
// [error] (kafkaStreams / update) sbt.librarymanagement.ResolveException: download failed: javax.ws.rs#javax.ws.rs-api;2.1!javax.ws.rs-api.${packaging.type}
val workaround = {
sys.props += "packaging.type" -> "jar"
()
}
lazy val root = (project in file("."))
.settings(name := "scalatest-embedded-kafka-root")
.settings(commonSettings: _*)
.settings(publishArtifact := false)
.settings(publish := {})
.settings(releaseSettings: _*)
.disablePlugins(BintrayPlugin)
.settings(publishTo := Some(Resolver.defaultLocal))
.aggregate(embeddedKafka, kafkaStreams, schemaRegistry)
lazy val embeddedKafka = (project in file("embedded-kafka"))
.settings(name := "scalatest-embedded-kafka")
.settings(publishSettings: _*)
.settings(commonSettings: _*)
.settings(commonLibrarySettings)
.settings(
libraryDependencies += "org.mockito" % "mockito-core" % "2.19.1" % Test)
.settings(releaseSettings: _*)
lazy val kafkaStreams = (project in file("kafka-streams"))
.settings(name := "scalatest-embedded-kafka-streams")
.settings(publishSettings: _*)
.settings(commonSettings: _*)
.settings(commonLibrarySettings)
.settings(releaseSettings: _*)
.settings(libraryDependencies +=
"org.apache.kafka" % "kafka-streams" % kafkaVersion)
.dependsOn(embeddedKafka)
lazy val schemaRegistry = (project in file("schema-registry"))
.settings(name := "scalatest-embedded-schema-registry")
.settings(publishSettings: _*)
.settings(commonSettings: _*)
.settings(commonLibrarySettings)
.settings(releaseSettings: _*)
.settings(resolvers ++= Seq(
"confluent" at "https://packages.confluent.io/maven/"))
.settings(libraryDependencies ++= Seq(
"org.apache.kafka" % "kafka-streams" % kafkaVersion,
"io.confluent" % "kafka-avro-serializer" % confluentVersion,
"io.confluent" % "kafka-schema-registry" % confluentVersion,
"io.confluent" % "kafka-schema-registry" % confluentVersion classifier "tests",
))
.dependsOn(embeddedKafka % "compile->compile;test->test",
kafkaStreams % "compile->compile;test->test")