-
Notifications
You must be signed in to change notification settings - Fork 3
/
BUILD.bazel
80 lines (70 loc) · 3 KB
/
BUILD.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test")
load("@rules_spring//springboot:springboot.bzl", "springboot")
package(default_visibility = ["//visibility:public"])
java_library(
name = "java-maven-lib",
srcs = glob(["src/main/java/org/daming/hoteler/*.java"]),
deps = [
"@maven//:org_springframework_boot_spring_boot_starter_web",
"@maven//:org_springframework_boot_spring_boot_starter_jdbc",
"@maven//:org_springframework_boot_spring_boot_starter_aop",
"@maven//:org_springframework_boot_spring_boot_starter_security",
"@maven//:org_springframework_boot_spring_boot_starter_cache",
"@maven//:org_springframework_boot_spring_boot_starter_actuator",
"@maven//:org_springframework_boot_spring_boot_starter_data_redis",
"@maven//:org_springframework_boot_spring_boot_starter_graphql",
"@maven//:org_springframework_boot_spring_boot_starter_quartz",
"@maven//:org_mybatis_spring_boot_mybatis_spring_boot_starter",
"@maven//:org_postgresql_postgresql",
"@maven//:org_springdoc_springdoc_openapi_starter_webmvc_ui",
"@maven//:io_jsonwebtoken_jjwt_api",
"@maven//:io_jsonwebtoken_jjwt_impl",
"@maven//:io_jsonwebtoken_jjwt_jackson",
"@maven//:commons_codec_commons_codec",
"@maven//:org_apache_commons_commons_lang3",
"@maven//:jakarta_xml_bind_jakarta_xml_bind_api",
"@maven//:cn_hutool_hutool_crypto",
"@maven//:org_springframework_boot_spring_boot",
"@maven//:org_springframework_boot_spring_boot_loader",
"@maven//:org_springframework_boot_spring_boot_autoconfigure",
"@maven//:org_springframework_spring_beans",
"@maven//:org_springframework_spring_web",
"@maven//:org_springframework_spring_context",
"@maven//:org_springframework_spring_tx",
],
resources = [
"//src/main/resources:resource",
],
)
java_binary(
name = "hoteler-jar",
main_class = "org.daming.hoteler.HotelerApplication",
resources = [
"//src/main/resources:resource",
],
runtime_deps = [":java-maven-lib"],
)
springboot(
name = "hoteler",
boot_app_class = "org.daming.hoteler.HotelerApplication",
# refrence the library
java_library = ":java-maven-lib",
boot_launcher_class = 'org.springframework.boot.loader.launch.JarLauncher',
)
java_test(
name = "tests",
srcs = glob([
"src/test/java/org/daming/hoteler/*.java",
"src/test/java/org/daming/hoteler/config/*.java",
]),
test_class = "org.daming.hoteler.HotelerApplicationTests",
deps = [
":java-maven-lib",
"@maven//:org_springframework_boot_spring_boot_starter_test",
"@maven//:org_springframework_security_spring_security_test",
"@maven//:org_springframework_boot_spring_boot_test",
"@maven//:org_springframework_spring_test",
"@maven//:org_junit_jupiter_junit_jupiter",
"@maven//:org_junit_jupiter_junit_jupiter_api",
],
)