Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Merged
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
60 changes: 3 additions & 57 deletions .kokoro/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.

set -eo pipefail
shopt -s nullglob

## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
Expand Down Expand Up @@ -41,9 +42,9 @@ function determineMavenOpts() {
then
# MaxPermSize is no longer supported as of jdk 17
echo -n "-Xmx1024m"
else
else
echo -n "-Xmx1024m -XX:MaxPermSize=128m"
fi
fi
}

export MAVEN_OPTS=$(determineMavenOpts)
Expand All @@ -56,58 +57,3 @@ retry_with_backoff 3 10 \
-Dclirr.skip=true

mvn -B dependency:analyze -DfailOnWarning=true

echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************"
## Run dependency list completeness check
function completenessCheck() {
# Output dep list with compile scope generated using the original pom
# Running mvn dependency:list on Java versions that support modules will also include the module of the dependency.
# This is stripped from the output as it is not present in the flattened pom.
# Only dependencies with 'compile' or 'runtime' scope are included from original dependency list.
msg "Generating dependency list using original pom..."
# Excluding commons-codec,commons-logging from the comparison as a temp fix
# Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737
mvn dependency:list -f pom.xml -DexcludeArtifactIds=commons-codec,commons-logging,grpc-googleapis -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt

# Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes)
msg "Generating dependency list using flattened pom..."
# Excluding commons-codec,commons-logging from the comparison as a temp fix
# Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737
mvn dependency:list -f .flattened-pom.xml -DexcludeArtifactIds=commons-codec,commons-logging,grpc-googleapis -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt

# Compare two dependency lists
msg "Comparing dependency lists..."
diff .org-list.txt .new-list.txt >.diff.txt
if [[ $? == 0 ]]
then
msg "Success. No diff!"
else
msg "Diff found. See below: "
msg "You can also check .diff.txt file located in $1."
cat .diff.txt
return 1
fi
}

# Allow failures to continue running the script
set +e

error_count=0
for path in $(find -name ".flattened-pom.xml")
do
# Check flattened pom in each dir that contains it for completeness
dir=$(dirname "$path")
pushd "$dir"
completenessCheck "$dir"
error_count=$(($error_count + $?))
popd
done

if [[ $error_count == 0 ]]
then
msg "All checks passed."
exit 0
else
msg "Errors found. See log statements above."
exit 1
fi
1 change: 0 additions & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
java.common_templates(excludes=[
'.kokoro/nightly/samples.cfg',
'.kokoro/presubmit/samples.cfg',
'.kokoro/dependencies.sh',
Copy link
Copy Markdown
Member Author

@suztomo suztomo Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this file excluded? It's because we had to add exclusions specific to this repository https://github.com/googleapis/java-bigquery/pull/1266/files#diff-567d21712b8e585cfcb63e34de4bf9e8aa76df9c564ae6caa769051752898cd6R55

'codecov.yaml',
'renovate.json',
'.kokoro/build.sh'
Expand Down