Skip to content

Commit f8823de

Browse files
salehsquaredSaleh MostafaSurferJeffAtGoogle
authored
build: update dependencies check to only check for runtime and compile scopes (#678)
* change:Updated dependencies check to only use runtime & compile scope * Update dependencies.sh * feat: update dependencies check to only check for runtime and compile scopes Co-authored-by: Saleh Mostafa <salehmostafa@google.com> Co-authored-by: Jeffrey Rennie <rennie@google.com>
1 parent 4530cc6 commit f8823de

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

synthtool/gcp/templates/java_library/.kokoro/dependencies.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ function completenessCheck() {
4343
# Output dep list with compile scope generated using the original pom
4444
# Running mvn dependency:list on Java versions that support modules will also include the module of the dependency.
4545
# This is stripped from the output as it is not present in the flattened pom.
46+
# Only dependencies with 'compile' or 'runtime' scope are included from original dependency list.
4647
msg "Generating dependency list using original pom..."
47-
mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// | grep -v ':test$' >.org-list.txt
48+
mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt
4849

49-
# Output dep list generated using the flattened pom (test scope deps are ommitted)
50+
# Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes)
5051
msg "Generating dependency list using flattened pom..."
51-
mvn dependency:list -f .flattened-pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt
52+
mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt
5253

5354
# Compare two dependency lists
5455
msg "Comparing dependency lists..."
@@ -85,4 +86,4 @@ then
8586
else
8687
msg "Errors found. See log statements above."
8788
exit 1
88-
fi
89+
fi

0 commit comments

Comments
 (0)