diff --git a/java/BUILD.bazel b/java/BUILD.bazel index fa6d8ba74f..1b45507282 100644 --- a/java/BUILD.bazel +++ b/java/BUILD.bazel @@ -26,6 +26,7 @@ sh_test( ] + glob([ "pom.xml", "*/pom.xml", + "test/linkage-monitor-check-bom/pom.xml", ]), ) diff --git a/java/linkage_monitor.sh b/java/linkage_monitor.sh index 3adae2b58d..e6a54a8b3e 100755 --- a/java/linkage_monitor.sh +++ b/java/linkage_monitor.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -e -o pipefail echo "Running Linkage Monitor check" @@ -17,22 +17,27 @@ fi cd java +# Install the test BOM for Linkage Monitor +pushd test/linkage-monitor-check-bom +mvn -e -B install +popd + # Linkage Monitor requires the artifacts to be available in local Maven # repository. -mvn --projects "bom,core,util" -e -B -Dhttps.protocols=TLSv1.2 clean generate-sources install \ +mvn -e -B clean generate-sources install \ + -Dhttps.protocols=TLSv1.2 \ -Dmaven.test.skip=true \ -Dprotobuf.basedir="../.." \ -Dprotoc="${protoc_location}" echo "Installed the artifacts to local Maven repository" -curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/linkage-monitor-latest-all-deps.jar" +curl -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/linkage-monitor-latest-all-deps.jar" echo "Running linkage-monitor-latest-all-deps.jar." -# The generated libraries in google-cloud-shared-dependencies would detect -# incompatible changes via Linkage Monitor -# https://github.com/googleapis/sdk-platform-java/tree/main/java-shared-dependencies -java -Xmx2048m -jar linkage-monitor-latest-all-deps.jar com.google.cloud:google-cloud-shared-dependencies +# The libraries in the BOM would detect incompatible changes via Linkage Monitor +java -Xmx2048m -jar linkage-monitor-latest-all-deps.jar \ + com.google.protobuf.test:linkage-monitor-check-bom echo "Finished running Linkage Monitor check" diff --git a/java/test/linkage-monitor-check-bom/pom.xml b/java/test/linkage-monitor-check-bom/pom.xml new file mode 100644 index 0000000000..e666cde608 --- /dev/null +++ b/java/test/linkage-monitor-check-bom/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + com.google.protobuf.test + linkage-monitor-check-bom + pom + 0.0.1-SNAPSHOT + Protobuf linkage monitor validation BOM + + A BOM to use in Linkage Monitor. This lists artifacts that use + Protobuf runtime libraries, such as gRPC and Google Cloud + client libraries. + We do not publish this pom.xml to Maven Central. + + + + 3.23.2 + + + + + com.google.protobuf + protobuf-bom + ${protobuf.version} + pom + import + + + io.grpc + grpc-bom + 1.55.3 + pom + import + + + com.google.api.grpc + grpc-google-common-protos + 2.22.0 + + + com.google.api.grpc + proto-google-common-protos + 2.22.0 + + + com.google.api.grpc + proto-google-iam-v1 + 1.17.0 + + + com.google.api.grpc + proto-google-iam-v2 + 1.17.0 + + + com.google.api.grpc + proto-google-iam-v2beta + 1.17.0 + + + com.google.cloud + google-cloud-bigquery + 2.29.0 + + + com.google.cloud + google-cloud-bigtable + 2.24.1 + + + +