diff --git a/private/rules/maven_bom_fragment.bzl b/private/rules/maven_bom_fragment.bzl index 9c3c2d263..97e980cae 100644 --- a/private/rules/maven_bom_fragment.bzl +++ b/private/rules/maven_bom_fragment.bzl @@ -12,9 +12,11 @@ MavenBomFragmentInfo = provider( ) def _maven_bom_fragment_impl(ctx): + # Expand maven coordinates for any variables to be replaced. + coordinates = ctx.attr.maven_coordinates.format(**ctx.var) return [ MavenBomFragmentInfo( - coordinates = ctx.attr.maven_coordinates, + coordinates = coordinates, artifact = ctx.file.artifact, srcs = ctx.file.src_artifact, javadocs = ctx.file.javadoc_artifact, diff --git a/private/rules/pom_file.bzl b/private/rules/pom_file.bzl index 1ca74f2ce..1cea8486a 100644 --- a/private/rules/pom_file.bzl +++ b/private/rules/pom_file.bzl @@ -8,9 +8,10 @@ def _pom_file_impl(ctx): info = ctx.attr.target[MavenInfo] + coordinates = info.coordinates.format(**ctx.var) out = generate_pom( ctx, - coordinates = info.coordinates, + coordinates = coordinates, versioned_dep_coordinates = sorted(info.maven_deps.to_list()), pom_template = ctx.file.pom_template, out_name = "%s.xml" % ctx.label.name,