Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edge case where dep depends on a pom file #186

Merged
merged 1 commit into from
Nov 7, 2024
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
20 changes: 14 additions & 6 deletions crawl/bazel.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,20 @@ def _get_direct_deps(direct_dep_coords_wo_vers, coord_wo_vers_to_dep, maven_inst
break

if direct_dep is None:
msg = "Failed to find top level dependency instance for [{0}] with direct dep coord [{1}]".format(
maven_install_filename, direct_dep_coord_wo_vers)
logger.warning(msg)
assert not fail_on_missing, msg
return []
direct_deps.append(direct_dep)
if direct_dep_coord_wo_vers.endswith(":pom"):
# this is an edge case where a dependency is a pom
# ex: org.kie.modules:org-apache-commons-lang3:pom
msg = "Direct dependency on a pom [{0}] in namespace [{1}] is ignored. Please depend on actual jar files instead.".format(
direct_dep_coord_wo_vers, maven_install_filename)
logger.warning(msg)
else:
msg = "Failed to find top level dependency instance for [{0}] with direct dep coord [{1}]".format(
maven_install_filename, direct_dep_coord_wo_vers)
logger.warning(msg)
assert not fail_on_missing, msg
return []
else:
direct_deps.append(direct_dep)
return direct_deps


Expand Down
3 changes: 2 additions & 1 deletion tests/bazeltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ def _get_dep_and_transitives(self, result, group_id, artifact_id, rule_name):
"google.guava:guava"
],
"org.apache.kafka:kafka-clients:jar:test": [
"ch.qos.logback:logback-core"
"ch.qos.logback:logback-core",
"org.kie.modules:org-apache-commons-lang3:pom"
],
"org.springframework.kafka:spring-kafka-test": [
"org.apache.kafka:kafka-clients:jar:test"
Expand Down
Loading