|
| 1 | +""" |
| 2 | +Bazel MODULE for kubernetes-client/java. |
| 3 | +
|
| 4 | +This enables building the library with Bazel in addition to Maven. |
| 5 | +Key features: |
| 6 | + - rules_jvm_external manages all Maven dependencies. |
| 7 | + - contrib_rules_jvm provides java_test_suite for JUnit 5 test discovery. |
| 8 | + - Remote-cache and disk-cache settings live in .bazelrc / .bazelrc.user. |
| 9 | +""" |
| 10 | + |
| 11 | +module( |
| 12 | + name = "kubernetes_client_java", |
| 13 | + version = "27.0.0-SNAPSHOT", |
| 14 | + compatibility_level = 1, |
| 15 | +) |
| 16 | + |
| 17 | +bazel_dep(name = "bazel_skylib", version = "1.7.1") |
| 18 | +bazel_dep(name = "rules_java", version = "7.12.2") |
| 19 | +bazel_dep(name = "rules_jvm_external", version = "6.7") |
| 20 | +bazel_dep(name = "contrib_rules_jvm", version = "0.27.0") |
| 21 | + |
| 22 | +# --------------------------------------------------------------------------- |
| 23 | +# Maven dependency management |
| 24 | +# --------------------------------------------------------------------------- |
| 25 | + |
| 26 | +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") |
| 27 | + |
| 28 | +maven.install( |
| 29 | + artifacts = [ |
| 30 | + # ---- core ---- |
| 31 | + # Versions kept in sync with the property values in the root pom.xml. |
| 32 | + "jakarta.annotation:jakarta.annotation-api:3.0.0", |
| 33 | + "io.swagger:swagger-annotations:1.6.16", |
| 34 | + "com.squareup.okhttp3:okhttp:5.3.2", |
| 35 | + "com.squareup.okhttp3:okhttp-jvm:5.3.2", |
| 36 | + "com.squareup.okhttp3:logging-interceptor:5.3.2", |
| 37 | + "com.squareup.okio:okio:3.16.4", |
| 38 | + "com.squareup.okio:okio-jvm:3.16.4", |
| 39 | + "com.google.code.gson:gson:2.14.0", |
| 40 | + "com.fasterxml.jackson.core:jackson-databind:2.21.2", |
| 41 | + "com.fasterxml.jackson.core:jackson-core:2.21.2", |
| 42 | + "com.fasterxml.jackson.core:jackson-annotations:2.21", |
| 43 | + "io.gsonfire:gson-fire:1.9.0", |
| 44 | + "org.apache.commons:commons-lang3:3.20.0", |
| 45 | + "org.apache.commons:commons-collections4:4.5.0", |
| 46 | + "org.apache.commons:commons-compress:1.28.0", |
| 47 | + "commons-io:commons-io:2.22.0", |
| 48 | + "commons-codec:commons-codec:1.22.0", |
| 49 | + "org.yaml:snakeyaml:2.6", |
| 50 | + "org.slf4j:slf4j-api:2.0.17", |
| 51 | + "org.bouncycastle:bcpkix-jdk18on:1.84", |
| 52 | + "org.bouncycastle:bcprov-jdk18on:1.84", |
| 53 | + "com.google.protobuf:protobuf-java:4.34.1", |
| 54 | + "org.bitbucket.b_c:jose4j:0.9.6", |
| 55 | + "com.google.auth:google-auth-library-oauth2-http:1.46.0", |
| 56 | + "software.amazon.awssdk:auth:2.43.0", |
| 57 | + "software.amazon.awssdk:http-auth-aws:2.43.0", |
| 58 | + "software.amazon.awssdk:http-auth-spi:2.43.0", |
| 59 | + "software.amazon.awssdk:http-client-spi:2.43.0", |
| 60 | + "software.amazon.awssdk:sts:2.43.0", |
| 61 | + "software.amazon.awssdk:utils:2.43.0", |
| 62 | + "io.prometheus:simpleclient:0.16.0", |
| 63 | + "io.prometheus:simpleclient_httpserver:0.16.0", |
| 64 | + "com.bucket4j:bucket4j-core:8.10.1", |
| 65 | + "com.github.ben-manes.caffeine:caffeine:3.0.0", |
| 66 | + "com.flipkart.zjsonpatch:zjsonpatch:0.4.16", |
| 67 | + "org.jetbrains:annotations:26.1.0", |
| 68 | + "org.reflections:reflections:0.10.2", |
| 69 | + # ---- spring (Java 17+ modules) ---- |
| 70 | + # spring-boot 4.0.6 transitively brings in spring-framework 7.0.x, but the |
| 71 | + # root pom.xml pins spring.version=6.2.12. Explicitly declare all |
| 72 | + # spring-framework modules at 6.2.12 and use maven.artifact() with |
| 73 | + # exclusions on the spring-boot artifacts so Coursier does not upgrade them. |
| 74 | + "org.springframework:spring-aop:6.2.12", |
| 75 | + "org.springframework:spring-beans:6.2.12", |
| 76 | + "org.springframework:spring-context:6.2.12", |
| 77 | + "org.springframework:spring-core:6.2.12", |
| 78 | + "org.springframework:spring-expression:6.2.12", |
| 79 | + "org.springframework:spring-test:6.2.12", |
| 80 | + # ---- test ---- |
| 81 | + "org.junit.jupiter:junit-jupiter-api:5.13.4", |
| 82 | + "org.junit.jupiter:junit-jupiter-engine:5.13.4", |
| 83 | + "org.junit.jupiter:junit-jupiter-params:5.13.4", |
| 84 | + "org.junit.platform:junit-platform-launcher:1.13.4", |
| 85 | + "org.junit.platform:junit-platform-commons:1.13.4", |
| 86 | + "org.junit.platform:junit-platform-engine:1.13.4", |
| 87 | + "org.junit.platform:junit-platform-reporting:1.13.4", |
| 88 | + "org.mockito:mockito-core:5.23.0", |
| 89 | + "org.mockito:mockito-junit-jupiter:5.23.0", |
| 90 | + "uk.org.webcompere:system-stubs-jupiter:2.1.8", |
| 91 | + "uk.org.webcompere:system-stubs-core:2.1.8", |
| 92 | + "org.wiremock:wiremock:3.13.2", |
| 93 | + "org.awaitility:awaitility:4.3.0", |
| 94 | + "org.assertj:assertj-core:3.27.7", |
| 95 | + "ch.qos.logback:logback-classic:1.5.32", |
| 96 | + "ch.qos.logback:logback-core:1.5.32", |
| 97 | + ], |
| 98 | + repositories = [ |
| 99 | + "https://repo1.maven.org/maven2", |
| 100 | + "https://repo.spring.io/milestone", |
| 101 | + ], |
| 102 | + fetch_sources = False, |
| 103 | + lock_file = "//:maven_install.json", |
| 104 | +) |
| 105 | + |
| 106 | +# Spring Boot 4.0.6 artifacts declared with exclusions to pin spring-framework at |
| 107 | +# 6.2.12 (matching pom.xml spring.version) instead of the 7.0.x that spring-boot |
| 108 | +# 4.0.x normally pulls in. |
| 109 | +_SPRING_FRAMEWORK_EXCLUSIONS = [ |
| 110 | + "org.springframework:spring-aop", |
| 111 | + "org.springframework:spring-beans", |
| 112 | + "org.springframework:spring-context", |
| 113 | + "org.springframework:spring-core", |
| 114 | + "org.springframework:spring-expression", |
| 115 | + "org.springframework:spring-test", |
| 116 | +] |
| 117 | + |
| 118 | +maven.artifact( |
| 119 | + artifact = "spring-boot", |
| 120 | + group = "org.springframework.boot", |
| 121 | + version = "4.0.6", |
| 122 | + exclusions = _SPRING_FRAMEWORK_EXCLUSIONS, |
| 123 | +) |
| 124 | + |
| 125 | +maven.artifact( |
| 126 | + artifact = "spring-boot-autoconfigure", |
| 127 | + group = "org.springframework.boot", |
| 128 | + version = "4.0.6", |
| 129 | + exclusions = _SPRING_FRAMEWORK_EXCLUSIONS, |
| 130 | +) |
| 131 | + |
| 132 | +maven.artifact( |
| 133 | + artifact = "spring-boot-actuator", |
| 134 | + group = "org.springframework.boot", |
| 135 | + version = "4.0.6", |
| 136 | + exclusions = _SPRING_FRAMEWORK_EXCLUSIONS, |
| 137 | +) |
| 138 | + |
| 139 | +maven.artifact( |
| 140 | + artifact = "spring-boot-test", |
| 141 | + group = "org.springframework.boot", |
| 142 | + version = "4.0.6", |
| 143 | + exclusions = _SPRING_FRAMEWORK_EXCLUSIONS, |
| 144 | +) |
| 145 | + |
| 146 | +use_repo(maven, "maven") |
0 commit comments