Skip to content

Fix bannedDependencies failure for jackson-module-scala in Cosmos Spark POMs#49261

Closed
jeet1995 wants to merge 1 commit into
mainfrom
fix/jackson-module-scala-enforcer-bump
Closed

Fix bannedDependencies failure for jackson-module-scala in Cosmos Spark POMs#49261
jeet1995 wants to merge 1 commit into
mainfrom
fix/jackson-module-scala-enforcer-bump

Conversation

@jeet1995
Copy link
Copy Markdown
Member

Problem

After the Jackson 2.18.6 to 2.18.7 dependency bump in PR #49180, the maven-enforcer-plugin bannedDependencies rule in azure-cosmos-spark_3/pom.xml rejects jackson-module-scala 2.18.7 as banned. This blocks all PRs that trigger Cosmos Spark builds (e.g., #49095, #49258).

Root Cause

The Spark parent POM used a custom Maven property <scala-jackson.version> for the jackson-module-scala version. While this property had a valid {x-version-update} comment, the update_versions.py script's regex (external_dependency_version_regex in eng/versioning/utils.py) only matches values inside <version>...</version> XML elements -- not custom property tags like <scala-jackson.version>...</scala-jackson.version>.

When PR #49180 ran update_versions.py, it:

  • Updated all <version> tags (afterburner, dataformat-xml, databind) to 2.18.7
  • Updated all {x-include-update} enforcer entries to [2.18.7]
  • Silently skipped the <scala-jackson.version> property (left at 2.18.6)

Result: The enforcer allowlist permits only [2.18.6] for jackson-module-scala, but Maven resolves 2.18.7 -- banned.

Fix

Eliminate the scala-jackson.version property indirection entirely and replace all usages with explicit versions + standard {x-version-update}/{x-include-update} tags -- the same pattern used by all other Jackson modules in these POMs.

Changes (4 files, net -4 lines):

  • Remove <scala-jackson.version> property from spark_3, spark_3-5, spark_3-5_2-12, and spark_4 parent POMs
  • Replace enforcer <include> entries with hardcoded [2.18.7] + {x-include-update} tags (spark_3/pom.xml)
  • Replace dependency <version> elements with explicit 2.18.7 + {x-version-update} tags (spark_3-5, spark_4)

Future update_versions.py runs will update these versions correctly since they now use standard <version> tags.

Note

The underlying tooling limitation (external_dependency_version_regex in eng/versioning/utils.py line 30 only matching <version> tags) will be addressed in a separate eng-sys PR.

The update_versions.py script's regex (external_dependency_version_regex)
only matches values inside <version>...</version> XML elements. Custom
Maven property tags like <scala-jackson.version> were silently skipped
despite having valid {x-version-update} comments, leaving the enforcer
allowlist stale after the Jackson 2.18.6 -> 2.18.7 bump (PR #49180).

This fix eliminates the scala-jackson.version property indirection
entirely and replaces all usages with explicit versions and standard
{x-version-update}/{x-include-update} tags — the same pattern used by
all other Jackson modules in these POMs.

Changes:
- Remove scala-jackson.version property from spark_3, spark_3-5,
  spark_3-5_2-12, and spark_4 parent POMs
- Replace enforcer <include> entries with hardcoded [2.18.7] +
  {x-include-update} tags (spark_3/pom.xml)
- Replace dependency <version> elements with explicit 2.18.7 +
  {x-version-update} tags (spark_3-5, spark_4)

Fixes the bannedDependencies CI failure blocking PRs #49095 and #49258.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Cosmos Spark Maven Enforcer bannedDependencies failures by removing the scala-jackson.version property indirection (which update_versions.py doesn’t update) and replacing it with explicit jackson-module-scala versions and standard {x-version-update} / {x-include-update} metadata so future Jackson bumps remain consistent.

Changes:

  • Removed the scala-jackson.version Maven property from Cosmos Spark parent POMs.
  • Hardcoded jackson-module-scala versions to 2.18.7 with standard {x-version-update} tags in Spark parent POMs.
  • Updated maven-enforcer-plugin allowlist entries to explicitly allow jackson-module-scala 2.18.7 for both Scala 2.12 and 2.13.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
sdk/cosmos/azure-cosmos-spark_4/pom.xml Removes scala-jackson.version and hardcodes jackson-module-scala version (but has a metadata mismatch to fix).
sdk/cosmos/azure-cosmos-spark_3/pom.xml Replaces enforcer allowlist entries to explicitly allow jackson-module-scala_2.12/_2.13 at 2.18.7.
sdk/cosmos/azure-cosmos-spark_3-5/pom.xml Removes scala-jackson.version and hardcodes jackson-module-scala version with {x-version-update}.
sdk/cosmos/azure-cosmos-spark_3-5_2-12/pom.xml Removes scala-jackson.version property from the module POM.

<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_${scala.binary.version}</artifactId>
<version>${scala-jackson.version}</version>
<version>2.18.7</version> <!-- {x-version-update;com.fasterxml.jackson.module:jackson-module-scala_2.12;external_dependency} -->
@jeet1995 jeet1995 closed this May 26, 2026
@jeet1995 jeet1995 deleted the fix/jackson-module-scala-enforcer-bump branch May 26, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants