-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathCommonCoursierModule.scala
More file actions
37 lines (33 loc) · 1.2 KB
/
CommonCoursierModule.scala
File metadata and controls
37 lines (33 loc) · 1.2 KB
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
package millbuild
import mill._, scalalib._
import coursier.MavenRepository
trait CommonCoursierModule extends CoursierModule {
override def mapDependencies: Task[coursier.Dependency => coursier.Dependency] = T.task {
super.mapDependencies().andThen { dep =>
forcedVersions
.find(t => t._1 == dep.module.organization.value && t._2 == dep.module.name.value)
.map { forced =>
val newDep = dep.withVersion(forced._3)
T.log.debug(s"Mapping $dep to $newDep")
newDep
}
.getOrElse(dep)
}
}
def repositoriesTask = T.task {
super.repositoriesTask() ++ Seq(
MavenRepository("https://oss.sonatype.org/content/repositories/releases"),
MavenRepository("https://oss.sonatype.org/content/repositories/snapshots"),
MavenRepository("http://dl.bintray.com/spark-packages/maven")
)
}
val forcedVersions = Seq(
("org.apache.ant", "ant", "1.10.12"),
("commons-io", "commons-io", "2.11.0"),
("com.google.code.gson", "gson", "2.9.0"),
("com.google.protobuf", "protobuf-java", "3.21.2"),
("com.google.guava", "guava", "32.0.1-jre"),
("org.jsoup", "jsoup", "1.15.3"),
("org.yaml", "snakeyaml", "1.33")
)
}