Merge pull request #13312 from mkruskal-google/java-linkage-fix

Backport java linkage monitor fix
pull/13323/head
Mike Kruskal 1 year ago committed by GitHub
commit d1b67884b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      java/BUILD.bazel
  2. 19
      java/linkage_monitor.sh
  3. 75
      java/test/linkage-monitor-check-bom/pom.xml

@ -26,6 +26,7 @@ sh_test(
] + glob([ ] + glob([
"pom.xml", "pom.xml",
"*/pom.xml", "*/pom.xml",
"test/linkage-monitor-check-bom/pom.xml",
]), ]),
) )

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -e -o pipefail
echo "Running Linkage Monitor check" echo "Running Linkage Monitor check"
@ -17,22 +17,27 @@ fi
cd java 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 # Linkage Monitor requires the artifacts to be available in local Maven
# repository. # 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 \ -Dmaven.test.skip=true \
-Dprotobuf.basedir="../.." \ -Dprotobuf.basedir="../.." \
-Dprotoc="${protoc_location}" -Dprotoc="${protoc_location}"
echo "Installed the artifacts to local Maven repository" 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." echo "Running linkage-monitor-latest-all-deps.jar."
# The generated libraries in google-cloud-shared-dependencies would detect # The libraries in the BOM would detect incompatible changes via Linkage Monitor
# incompatible changes via Linkage Monitor java -Xmx2048m -jar linkage-monitor-latest-all-deps.jar \
# https://github.com/googleapis/sdk-platform-java/tree/main/java-shared-dependencies com.google.protobuf.test:linkage-monitor-check-bom
java -Xmx2048m -jar linkage-monitor-latest-all-deps.jar com.google.cloud:google-cloud-shared-dependencies
echo "Finished running Linkage Monitor check" echo "Finished running Linkage Monitor check"

@ -0,0 +1,75 @@
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.protobuf.test</groupId>
<artifactId>linkage-monitor-check-bom</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version><!-- we don't release this BOM -->
<name>Protobuf linkage monitor validation BOM</name>
<description>
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.
</description>
<properties>
<!--
This verison is ok to kept old. Linkage Monitor overrides this
version when checking linakage errors
-->
<protobuf.version>3.23.2</protobuf.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>${protobuf.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-bom</artifactId>
<version>1.55.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-common-protos</artifactId>
<version>2.22.0</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-common-protos</artifactId>
<version>2.22.0</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-iam-v1</artifactId>
<version>1.17.0</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-iam-v2</artifactId>
<version>1.17.0</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-iam-v2beta</artifactId>
<version>1.17.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>2.29.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable</artifactId>
<version>2.24.1</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Loading…
Cancel
Save