Skip to content

fix(pom_file): exclusions referenced before assignment#1503

Merged
shs96c merged 1 commit into
bazel-contrib:masterfrom
YavorPaunov:pom_file/fix_exclusions_scope
Dec 23, 2025
Merged

fix(pom_file): exclusions referenced before assignment#1503
shs96c merged 1 commit into
bazel-contrib:masterfrom
YavorPaunov:pom_file/fix_exclusions_scope

Conversation

@YavorPaunov
Copy link
Copy Markdown
Contributor

Under specific circumstances, the exclusions variable inside _pom_file_impl ends up being referenced before assignment. Moving it outside the if block fixes this.

More specifically, this happens when a maven_export has the target parameter set (to point to a jar file) instead of a lib_name. I have also added a test case that triggers this to prevent regression.

Under specific circumstances, the exclusions variable inside _pom_file_impl ends up being referenced before assignment. Moving it outside the if block fixes this.

More specifically, this happens when a maven_export has the target parameter set (to point to a jar file) instead of a lib_name. I have also added a test case that triggers this to prevent regression.
Copy link
Copy Markdown
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

LGTM. Nice catch. Thank you

@shs96c shs96c merged commit 8197c2a into bazel-contrib:master Dec 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants