-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE.bazel
63 lines (46 loc) · 1.76 KB
/
WORKSPACE.bazel
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
workspace(name = "java_dependencies")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
# Nothing here to load Java support, it is built in.
# Retrieve a dependency JAR in the simplest available way. We'll see
# more complex mechanisms later.
http_jar(
name = "guava",
sha256 = "d5be94d65e87bd219fb3193ad1517baa55a3b88fc91d21cf735826ab5af087b9",
urls = ["https://repo1.maven.org/maven2/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar"],
)
# Official Bazel tools to get Maven repo dependencies; there are other
# unofficial tools also.
RULES_JVM_EXTERNAL_TAG = "4.2"
RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca"
http_archive(
name = "rules_jvm_external",
sha256 = RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"junit:junit:4.13.2",
"com.sparkjava:spark-core:2.9.3",
],
maven_install_json = "//:maven_install.json",
repositories = [
"https://jcenter.bintray.com/",
"https://repo1.maven.org/maven2",
],
)
# behind the scenes, this uses https://get-coursier.io/docs/other-credentials
# Pinning is both safer (like an NPM package-lock.json) and avoids
# the spurious use of an OS-installed JVM.
load("@maven//:defs.bzl", "pinned_maven_install")
pinned_maven_install(
# name = "maven",
)
# Initial pin:
# bazel run @maven//:pin
# Update or fill in incomplete pins
# bazel run @unpinned_maven//:pin
# <groupId>com.google.guava</groupId>
# <artifactId>guava</artifactId>
# <version>28.1-jre</version>