Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4.1
9.0.0
9 changes: 4 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ module(
)

# Python for dupe class checking support
bazel_dep(name = "rules_python", version = "0.40.0")
bazel_dep(name = "rules_python", version = "1.8.0")

# For License support
bazel_dep(name = "rules_license", version = "1.0.0")

# For unittest toolchain
bazel_dep(name = "bazel_skylib", version = "1.1.1")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_java", version = "9.3.0")

# DEV DEPENDENCIES

# Maven dependencies for the examples
bazel_dep(name = "rules_jvm_external", version = "6.6", dev_dependency = True)
bazel_dep(name = "rules_jvm_external", version = "6.9", dev_dependency = True)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True)
maven.install(
Expand Down Expand Up @@ -60,7 +61,6 @@ maven.install(
# a filter to exclude this dependency
"javax.annotation:javax.annotation-api:1.3.2",


# test deps
"junit:junit:4.13.2",
"org.hamcrest:hamcrest-core:2.2",
Expand Down Expand Up @@ -94,4 +94,3 @@ unmanaged_maven.install(
lock_file = "//springboot/deps_filter_rules/tests/external_deps:unmanaged_deps_filter_install.json",
)
use_repo(unmanaged_maven, "unmanaged_deps_filter")

430 changes: 324 additions & 106 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/demoapp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# to local path "//springboot" work here. But you will need to change them to:
# "@rules_spring//springboot" when you consume the official release via http_archive.

load("@rules_java//java:defs.bzl", "java_library", "java_test")
load("//springboot:springboot.bzl", "springboot")
load("//springboot/deps_filter_rules_legacy:deps_filter.bzl", "deps_filter")
load("//tools/license:licenses_used.bzl", "licenses_used")
Expand Down
2 changes: 2 additions & 0 deletions examples/demoapp/libs/lib1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#

load("@rules_java//java:defs.bzl", "java_library", "java_test")

deps = [
"@maven//:org_slf4j_slf4j_api",
]
Expand Down
2 changes: 2 additions & 0 deletions examples/demoapp/libs/lib2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#

load("@rules_java//java:defs.bzl", "java_library", "java_test")

deps = [
"@maven//:org_slf4j_slf4j_api",
]
Expand Down
6 changes: 4 additions & 2 deletions examples/demoapp/libs/lib3_neverlink/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#

load("@rules_java//java:defs.bzl", "java_library", "java_test")

deps = [
"@maven//:org_slf4j_slf4j_api",
]
Expand All @@ -17,11 +19,11 @@ test_deps = [
java_library(
name = "lib3_neverlink",
srcs = glob(["src/main/java/**/*.java"]),
visibility = ["//visibility:public"],
deps = deps,

# Signals that this is a compile only dep
neverlink = 1,
visibility = ["//visibility:public"],
deps = deps,
)

java_test(
Expand Down
15 changes: 8 additions & 7 deletions examples/helloworld/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# to local path "//springboot" work here. But you will need to change them to:
# "@rules_spring//springboot" when you consume the official release via http_archive.

load("@rules_java//java:defs.bzl", "java_library", "java_test")

# load our Spring Boot rule
load("//springboot:springboot.bzl", "springboot")

Expand All @@ -27,7 +29,6 @@ springboot_deps = [
"@maven//:org_springframework_boot_spring_boot_loader_tools",
"@maven//:org_springframework_boot_spring_boot_jarmode_tools",
"@maven//:org_springframework_spring_webmvc",

"@maven//:javax_annotation_javax_annotation_api",
]

Expand All @@ -45,22 +46,22 @@ test_deps = [
]

java_test(
name = "SampleRestUnitTest",
srcs = ["src/test/java/com/sample/SampleRestUnitTest.java"],
deps = [ ":helloworld_lib" ] + test_deps,
name = "SampleRestUnitTest",
srcs = ["src/test/java/com/sample/SampleRestUnitTest.java"],
deps = [":helloworld_lib"] + test_deps,
)

# Build the app as a Spring Boot executable jar
# To launch: bazel run //examples/helloworld
springboot(
name = "helloworld",
boot_app_class = "com.sample.SampleMain",
java_library = ":helloworld_lib",

# SPRING BOOT 3
# The launcher class changed in between Boot2 and Boot3, so we provide the
# Boot3 launcher class here (the Boot2 one is the default)
boot_launcher_class = 'org.springframework.boot.loader.launch.JarLauncher',
boot_launcher_class = "org.springframework.boot.loader.launch.JarLauncher",
java_library = ":helloworld_lib",
)

springboottest_deps = [
Expand All @@ -72,6 +73,6 @@ springboottest_deps = [
java_test(
name = "SampleRestFuncTest",
srcs = ["src/test/java/com/sample/SampleRestFuncTest.java"],
deps = [ ":helloworld_lib" ] + test_deps + springboottest_deps,
resources = glob(["src/test/resources/**"]),
deps = [":helloworld_lib"] + test_deps + springboottest_deps,
)
2 changes: 2 additions & 0 deletions examples/helloworld/libs/lib1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#

load("@rules_java//java:defs.bzl", "java_library", "java_test")

deps = [
"@maven//:org_slf4j_slf4j_api",
]
Expand Down
2 changes: 2 additions & 0 deletions examples/helloworld/libs/lib2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#

load("@rules_java//java:defs.bzl", "java_library", "java_test")

deps = [
"@maven//:org_slf4j_slf4j_api",
]
Expand Down
Loading