diff --git a/MODULE.bazel b/MODULE.bazel index 119230bc..9c9fdc32 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -176,6 +176,7 @@ dev_maven.install( artifacts = [ "com.google.guava:guava:31.1-jre", "org.hamcrest:hamcrest-core:2.1", + "io.netty:netty-tcnative-boringssl-static:2.0.61.Final", ], lock_file = "@rules_jvm_external//:maven_install.json", resolver = "coursier", diff --git a/WORKSPACE b/WORKSPACE index 543b0e6d..57f20dfa 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -98,6 +98,7 @@ maven_install( artifacts = [ "com.google.guava:guava:31.1-jre", "org.hamcrest:hamcrest-core:2.1", + "io.netty:netty-tcnative-boringssl-static:2.0.61.Final", ], maven_install_json = "@rules_jvm_external//:maven_install.json", repositories = [ diff --git a/maven_install.json b/maven_install.json index 3a659655..3abf41fb 100644 --- a/maven_install.json +++ b/maven_install.json @@ -1,29 +1,14 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": 1138598656, - "__RESOLVED_ARTIFACTS_HASH": -1439644340, - "conflict_resolution": { - "com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.11.0" - }, + "__INPUT_ARTIFACTS_HASH": -1642503178, + "__RESOLVED_ARTIFACTS_HASH": -1242467072, "artifacts": { - "com.google.auto.value:auto-value-annotations": { - "shasums": { - "jar": "fedd59b0b4986c342f6ab2d182f2a4ee9fceb2c7e2d5bdc4dc764c92394a23d3" - }, - "version": "1.7.4" - }, "com.google.code.findbugs:jsr305": { "shasums": { "jar": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7" }, "version": "3.0.2" }, - "com.google.code.gson:gson": { - "shasums": { - "jar": "d3999291855de495c94c743761b8ab5176cfeabe281a5ab0d8e8d45326fd703e" - }, - "version": "2.8.9" - }, "com.google.errorprone:error_prone_annotations": { "shasums": { "jar": "721cb91842b46fa056847d104d5225c8b8e1e8b62263b993051e1e5a0137b7ec" @@ -42,12 +27,6 @@ }, "version": "31.1-jre" }, - "com.google.guava:guava-testlib": { - "shasums": { - "jar": "aadc71b10d5c3ac474dd16be84cfb18d257e584d1e0a59f8cab64ef4376226ce" - }, - "version": "31.1-jre" - }, "com.google.guava:listenablefuture": { "shasums": { "jar": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99" @@ -60,29 +39,22 @@ }, "version": "1.3" }, - "com.google.truth:truth": { - "shasums": { - "jar": "a85e03b8b6ae8780f060cfded9500a3d1b5f52808f99a2ea6da9c683313c7518" - }, - "version": "1.1.2" - }, - "junit:junit": { - "shasums": { - "jar": "8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3" - }, - "version": "4.13.2" - }, - "net.bytebuddy:byte-buddy": { + "io.netty:netty-tcnative-boringssl-static": { "shasums": { - "jar": "d2e46555699e70361b5471a7e142f9c67855bba6907a285177ebd8ad973775d8" + "jar": "b6f974972c44cd6f9cecabc255290286faac40b6393c66c3c3c0db7f421cc28e", + "linux-aarch_64": "3614395218ae379cec22ccaa089c4f27b9329a660e0d53c93e7cb12b7a2cee46", + "linux-x86_64": "4ff9d14f1ec6ccee35b78f53a6f3d9c7c54535aa2a76138311c2f619c5e150e1", + "osx-aarch_64": "58e0302c9fde3db984c3ff7ee7ec7159dc0320bdb91533cc290e12e40911cd1a", + "osx-x86_64": "fcfea887f4f0802d363c699b444d504b7109a7cb198ae6845eeff63745e5b0ba", + "windows-x86_64": "17cd2fa3c63b7ed23edea01c945e55cb7baed1faa0f553732c3f5f56da90b3e0" }, - "version": "1.12.7" + "version": "2.0.61.Final" }, - "net.bytebuddy:byte-buddy-agent": { + "io.netty:netty-tcnative-classes": { "shasums": { - "jar": "73d84bb6e8e8980e674d796a29063f510ceb527c6f8c912a08a13e236be05c71" + "jar": "9b970eccd844bfae175a5cbbf7bf94891894add06d6ccbe1abf2250cd64080f6" }, - "version": "1.12.7" + "version": "2.0.61.Final" }, "org.checkerframework:checker-qual": { "shasums": { @@ -101,24 +73,6 @@ "jar": "e09109e54a289d88506b9bfec987ddd199f4217c9464132668351b9a4f00bee9" }, "version": "2.1" - }, - "org.mockito:mockito-core": { - "shasums": { - "jar": "148de2c6928365db29443ca12d35c930d9f481172b934fdd801d1cb1409ea83a" - }, - "version": "4.3.1" - }, - "org.objenesis:objenesis": { - "shasums": { - "jar": "03d960bd5aef03c653eb000413ada15eb77cdd2b8e4448886edf5692805e35f3" - }, - "version": "3.2" - }, - "org.ow2.asm:asm": { - "shasums": { - "jar": "0df97574914aee92fd349d0cb4e00f3345d45b2c239e0bb50f0a90ead47888e0" - }, - "version": "9.0" } }, "dependencies": { @@ -130,56 +84,59 @@ "com.google.j2objc:j2objc-annotations", "org.checkerframework:checker-qual" ], - "com.google.guava:guava-testlib": [ - "com.google.code.findbugs:jsr305", - "com.google.errorprone:error_prone_annotations", - "com.google.guava:guava", - "com.google.j2objc:j2objc-annotations", - "junit:junit", - "org.checkerframework:checker-qual" - ], - "com.google.truth:truth": [ - "com.google.auto.value:auto-value-annotations", - "com.google.errorprone:error_prone_annotations", - "com.google.guava:guava", - "junit:junit", - "org.checkerframework:checker-qual", - "org.ow2.asm:asm" - ], - "junit:junit": [ - "org.hamcrest:hamcrest-core" + "io.netty:netty-tcnative-boringssl-static": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-classes" ], "org.hamcrest:hamcrest-core": [ "org.hamcrest:hamcrest" - ], - "org.mockito:mockito-core": [ - "net.bytebuddy:byte-buddy", - "net.bytebuddy:byte-buddy-agent", - "org.objenesis:objenesis" ] }, "packages": { - "com.google.auto.value:auto-value-annotations": [ - "com.google.auto.value", - "com.google.auto.value.extension.memoized", - "com.google.auto.value.extension.serializable" - ], "com.google.code.findbugs:jsr305": [ "javax.annotation", "javax.annotation.concurrent", "javax.annotation.meta" ], - "com.google.code.gson:gson": [ - "com.google.gson", - "com.google.gson.annotations", - "com.google.gson.internal", - "com.google.gson.internal.bind", - "com.google.gson.internal.bind.util", - "com.google.gson.internal.reflect", - "com.google.gson.internal.sql", - "com.google.gson.reflect", - "com.google.gson.stream" - ], "com.google.errorprone:error_prone_annotations": [ "com.google.errorprone.annotations", "com.google.errorprone.annotations.concurrent" @@ -207,98 +164,11 @@ "com.google.common.xml", "com.google.thirdparty.publicsuffix" ], - "com.google.guava:guava-testlib": [ - "com.google.common.collect.testing", - "com.google.common.collect.testing.features", - "com.google.common.collect.testing.google", - "com.google.common.collect.testing.testers", - "com.google.common.escape.testing", - "com.google.common.testing", - "com.google.common.util.concurrent.testing" - ], "com.google.j2objc:j2objc-annotations": [ "com.google.j2objc.annotations" ], - "com.google.truth:truth": [ - "com.google.common.truth" - ], - "junit:junit": [ - "junit.extensions", - "junit.framework", - "junit.runner", - "junit.textui", - "org.junit", - "org.junit.experimental", - "org.junit.experimental.categories", - "org.junit.experimental.max", - "org.junit.experimental.results", - "org.junit.experimental.runners", - "org.junit.experimental.theories", - "org.junit.experimental.theories.internal", - "org.junit.experimental.theories.suppliers", - "org.junit.function", - "org.junit.internal", - "org.junit.internal.builders", - "org.junit.internal.management", - "org.junit.internal.matchers", - "org.junit.internal.requests", - "org.junit.internal.runners", - "org.junit.internal.runners.model", - "org.junit.internal.runners.rules", - "org.junit.internal.runners.statements", - "org.junit.matchers", - "org.junit.rules", - "org.junit.runner", - "org.junit.runner.manipulation", - "org.junit.runner.notification", - "org.junit.runners", - "org.junit.runners.model", - "org.junit.runners.parameterized", - "org.junit.validator" - ], - "net.bytebuddy:byte-buddy": [ - "net.bytebuddy", - "net.bytebuddy.agent.builder", - "net.bytebuddy.asm", - "net.bytebuddy.build", - "net.bytebuddy.description", - "net.bytebuddy.description.annotation", - "net.bytebuddy.description.enumeration", - "net.bytebuddy.description.field", - "net.bytebuddy.description.method", - "net.bytebuddy.description.modifier", - "net.bytebuddy.description.type", - "net.bytebuddy.dynamic", - "net.bytebuddy.dynamic.loading", - "net.bytebuddy.dynamic.scaffold", - "net.bytebuddy.dynamic.scaffold.inline", - "net.bytebuddy.dynamic.scaffold.subclass", - "net.bytebuddy.implementation", - "net.bytebuddy.implementation.attribute", - "net.bytebuddy.implementation.auxiliary", - "net.bytebuddy.implementation.bind", - "net.bytebuddy.implementation.bind.annotation", - "net.bytebuddy.implementation.bytecode", - "net.bytebuddy.implementation.bytecode.assign", - "net.bytebuddy.implementation.bytecode.assign.primitive", - "net.bytebuddy.implementation.bytecode.assign.reference", - "net.bytebuddy.implementation.bytecode.collection", - "net.bytebuddy.implementation.bytecode.constant", - "net.bytebuddy.implementation.bytecode.member", - "net.bytebuddy.jar.asm", - "net.bytebuddy.jar.asm.commons", - "net.bytebuddy.jar.asm.signature", - "net.bytebuddy.matcher", - "net.bytebuddy.pool", - "net.bytebuddy.utility", - "net.bytebuddy.utility.dispatcher", - "net.bytebuddy.utility.nullability", - "net.bytebuddy.utility.privilege", - "net.bytebuddy.utility.visitor" - ], - "net.bytebuddy:byte-buddy-agent": [ - "net.bytebuddy.agent", - "net.bytebuddy.agent.utility.nullability" + "io.netty:netty-tcnative-classes": [ + "io.netty.internal.tcnative" ], "org.checkerframework:checker-qual": [ "org.checkerframework.checker.builder.qual", @@ -346,111 +216,26 @@ ], "org.hamcrest:hamcrest-core": [ "org.hamcrest" - ], - "org.mockito:mockito-core": [ - "org.mockito", - "org.mockito.codegen", - "org.mockito.configuration", - "org.mockito.creation.instance", - "org.mockito.exceptions.base", - "org.mockito.exceptions.misusing", - "org.mockito.exceptions.stacktrace", - "org.mockito.exceptions.verification", - "org.mockito.exceptions.verification.junit", - "org.mockito.exceptions.verification.opentest4j", - "org.mockito.hamcrest", - "org.mockito.internal", - "org.mockito.internal.configuration", - "org.mockito.internal.configuration.injection", - "org.mockito.internal.configuration.injection.filter", - "org.mockito.internal.configuration.injection.scanner", - "org.mockito.internal.configuration.plugins", - "org.mockito.internal.creation", - "org.mockito.internal.creation.bytebuddy", - "org.mockito.internal.creation.instance", - "org.mockito.internal.creation.proxy", - "org.mockito.internal.creation.settings", - "org.mockito.internal.creation.util", - "org.mockito.internal.debugging", - "org.mockito.internal.exceptions", - "org.mockito.internal.exceptions.stacktrace", - "org.mockito.internal.exceptions.util", - "org.mockito.internal.framework", - "org.mockito.internal.hamcrest", - "org.mockito.internal.handler", - "org.mockito.internal.invocation", - "org.mockito.internal.invocation.finder", - "org.mockito.internal.invocation.mockref", - "org.mockito.internal.junit", - "org.mockito.internal.listeners", - "org.mockito.internal.matchers", - "org.mockito.internal.matchers.apachecommons", - "org.mockito.internal.matchers.text", - "org.mockito.internal.progress", - "org.mockito.internal.reporting", - "org.mockito.internal.runners", - "org.mockito.internal.runners.util", - "org.mockito.internal.session", - "org.mockito.internal.stubbing", - "org.mockito.internal.stubbing.answers", - "org.mockito.internal.stubbing.defaultanswers", - "org.mockito.internal.util", - "org.mockito.internal.util.collections", - "org.mockito.internal.util.concurrent", - "org.mockito.internal.util.io", - "org.mockito.internal.util.reflection", - "org.mockito.internal.verification", - "org.mockito.internal.verification.api", - "org.mockito.internal.verification.argumentmatching", - "org.mockito.internal.verification.checkers", - "org.mockito.invocation", - "org.mockito.junit", - "org.mockito.listeners", - "org.mockito.mock", - "org.mockito.plugins", - "org.mockito.quality", - "org.mockito.session", - "org.mockito.stubbing", - "org.mockito.verification" - ], - "org.objenesis:objenesis": [ - "org.objenesis", - "org.objenesis.instantiator", - "org.objenesis.instantiator.android", - "org.objenesis.instantiator.annotations", - "org.objenesis.instantiator.basic", - "org.objenesis.instantiator.gcj", - "org.objenesis.instantiator.perc", - "org.objenesis.instantiator.sun", - "org.objenesis.instantiator.util", - "org.objenesis.strategy" - ], - "org.ow2.asm:asm": [ - "org.objectweb.asm", - "org.objectweb.asm.signature" ] }, "repositories": { "https://repo1.maven.org/maven2/": [ - "com.google.auto.value:auto-value-annotations", "com.google.code.findbugs:jsr305", - "com.google.code.gson:gson", "com.google.errorprone:error_prone_annotations", "com.google.guava:failureaccess", "com.google.guava:guava", - "com.google.guava:guava-testlib", "com.google.guava:listenablefuture", "com.google.j2objc:j2objc-annotations", - "com.google.truth:truth", - "junit:junit", - "net.bytebuddy:byte-buddy", - "net.bytebuddy:byte-buddy-agent", + "io.netty:netty-tcnative-boringssl-static", + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes", "org.checkerframework:checker-qual", "org.hamcrest:hamcrest", - "org.hamcrest:hamcrest-core", - "org.mockito:mockito-core", - "org.objenesis:objenesis", - "org.ow2.asm:asm" + "org.hamcrest:hamcrest-core" ] }, "services": {}, diff --git a/tests/integration/maven_bom/BUILD b/tests/integration/maven_bom/BUILD index 281a9af3..ae5a504e 100644 --- a/tests/integration/maven_bom/BUILD +++ b/tests/integration/maven_bom/BUILD @@ -1,6 +1,5 @@ -load("@bazel_skylib//rules:diff_test.bzl", "diff_test") load("@bazel_skylib//rules:common_settings.bzl", "string_flag") -load("@rules_java//java:defs.bzl", "java_library") +load("@bazel_skylib//rules:diff_test.bzl", "diff_test") load("//:defs.bzl", "artifact", "java_export", "maven_bom") maven_bom( @@ -39,6 +38,10 @@ java_export( name = "one-dep", srcs = ["OneDep.java"], maven_coordinates = "com.example:one-dep:1.0.0", + visibility = [ + ":__pkg__", + "//tests/integration/pom_file:__pkg__", + ], deps = [ artifact("com.google.guava:guava"), ], diff --git a/tests/integration/pom_file/BUILD b/tests/integration/pom_file/BUILD new file mode 100644 index 00000000..30c8c048 --- /dev/null +++ b/tests/integration/pom_file/BUILD @@ -0,0 +1,55 @@ +load("@bazel_skylib//rules:diff_test.bzl", "diff_test") +load("//:defs.bzl", "artifact", "java_export") + +java_export( + name = "pom-example", + srcs = ["PomExample.java"], + maven_coordinates = "com.example:app:1.0.0", + deps = [ + "//tests/integration/maven_bom:one-dep", + ], +) + +diff_test( + name = "validate-pom", + file1 = ":pom-example-pom", + file2 = "pom.golden.xml", +) + +java_export( + name = "pom-example-with-runtime-dep", + srcs = ["PomExample.java"], + maven_coordinates = "com.example:app:1.0.0", + runtime_deps = [ + "//tests/integration/maven_bom:one-dep", + ], + deps = [ + "//tests/integration/maven_bom:one-dep", + artifact("com.google.guava:guava"), + ], +) + +diff_test( + name = "validate-pom-with-runtime-dep", + file1 = ":pom-example-with-runtime-dep-pom", + file2 = "pom-with-runtime-dep.golden.xml", +) + +java_export( + name = "pom-example-with-classifier-dep", + srcs = ["PomExample.java"], + maven_coordinates = "com.example:app:1.0.0", + runtime_deps = [ + "@maven//:io_netty_netty_tcnative_boringssl_static_linux_aarch_64", + ], + deps = [ + "@maven//:io_netty_netty_tcnative_boringssl_static_linux_aarch_64", + "@maven//:io_netty_netty_tcnative_boringssl_static_linux_x86_64", + ], +) + +diff_test( + name = "validate-pom-example-with-classifier-dep", + file1 = ":pom-example-with-classifier-dep-pom", + file2 = "pom-with-classifier-dep.golden.xml", +) diff --git a/tests/integration/pom_file/PomExample.java b/tests/integration/pom_file/PomExample.java new file mode 100644 index 00000000..a2d1961e --- /dev/null +++ b/tests/integration/pom_file/PomExample.java @@ -0,0 +1,8 @@ +package tests.integration.pom_file; + +public class PomExample { + + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/tests/integration/pom_file/pom-with-classifier-dep.golden.xml b/tests/integration/pom_file/pom-with-classifier-dep.golden.xml new file mode 100755 index 00000000..cd92ae2e --- /dev/null +++ b/tests/integration/pom_file/pom-with-classifier-dep.golden.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + com.example + app + 1.0.0 + + + + io.netty + netty-tcnative-boringssl-static + 2.0.61.Final + linux-aarch_64 + runtime + + + io.netty + netty-tcnative-boringssl-static + 2.0.61.Final + linux-x86_64 + + + diff --git a/tests/integration/pom_file/pom-with-runtime-dep.golden.xml b/tests/integration/pom_file/pom-with-runtime-dep.golden.xml new file mode 100755 index 00000000..7de26c63 --- /dev/null +++ b/tests/integration/pom_file/pom-with-runtime-dep.golden.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + com.example + app + 1.0.0 + + + + com.example + one-dep + 1.0.0 + runtime + + + com.google.guava + guava + 31.1-jre + + + diff --git a/tests/integration/pom_file/pom.golden.xml b/tests/integration/pom_file/pom.golden.xml new file mode 100755 index 00000000..e40e11f6 --- /dev/null +++ b/tests/integration/pom_file/pom.golden.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + com.example + app + 1.0.0 + + + + com.example + one-dep + 1.0.0 + + + diff --git a/tests/unit/exports/BUILD b/tests/unit/exports/BUILD index 9d6a5463..392006d5 100644 --- a/tests/unit/exports/BUILD +++ b/tests/unit/exports/BUILD @@ -1,4 +1,3 @@ -load("@rules_java//java:defs.bzl", "java_library") load("//tests/unit/exports:exports_test.bzl", "exports_tests") exports_tests(name = "exports_tests")