Skip to content

ci: fix enforce-banned-duplicate-classes in first-party-dependencies and gax-bom - #14492

Open
blakeli0 wants to merge 1 commit into
googleapis:mainfrom
blakeli0:fix/ban-duplicate-classes-pom-modules
Open

blakeli0 wants to merge 1 commit into
googleapis:mainfrom
blakeli0:fix/ban-duplicate-classes-pom-modules

Conversation

@blakeli0

@blakeli0 blakeli0 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes No rules are configured errors encountered in the ban-duplicate-classes workflow on first-party-dependencies and gax-bom (e.g. in release PR #14491).

Background

In #14142 and #14272, the enforcer plugin was split into:

  1. enforce (fast metadata rules for PRs)
  2. enforce-banned-duplicate-classes (runs banDuplicateClasses on release branches via mvn -B -ntp enforcer:enforce@enforce-banned-duplicate-classes -T 1C)

When invoking a specific Maven execution ID across a multi-module reactor (plugin:goal@executionId), Maven creates an empty ad-hoc execution for any module that does not define that execution ID. Because maven-enforcer-plugin requires at least one rule (or skip=true), this caused the ban-duplicate-classes job to fail on:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-banned-duplicate-classes) on project first-party-dependencies: No rules are configured. Use the skip flag if you want to disable execution.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-banned-duplicate-classes) on project gax-bom: No rules are configured. Use the skip flag if you want to disable execution.

Changes

  • first-party-dependencies: Updates the parent to the in-repo google-cloud-shared-config (1.22.0-SNAPSHOT) with relativePath and the {x-version-update} tag. Both share groupId: com.google.cloud and are staged/released together, matching the pattern in sdk-platform-java-config and grpc-gcp-java.
  • gax-bom: Adds an explicit skip for enforce-banned-duplicate-classes. gax-bom has groupId: com.google.api (different from com.google.cloud) and retains a released google-cloud-shared-config parent from Central to avoid cross-groupId publication-ordering cycles in Sonatype staging.

Verification

  • Verified mvn enforcer:enforce@enforce-banned-duplicate-classes -pl :gax-bom,:first-party-dependencies passes.
  • Verified mvn enforcer:enforce@enforce -pl :gax-bom,:first-party-dependencies passes.

@blakeli0
blakeli0 requested review from a team as code owners September 23, 2026 20:06

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request configures the 'maven-enforcer-plugin' to skip the 'enforce-banned-duplicate-classes' execution in the POM-only modules 'gax-bom' and 'first-party-dependencies'. This prevents "No rules are configured" errors during build execution due to inheriting a released version of 'google-cloud-shared-config' that does not define this rule. I have no feedback to provide.

…and gax-bom

In googleapis#14142 and googleapis#14272, the enforcer was split into a fast PR check (enforce)
and a release check (enforce-banned-duplicate-classes). Modules without this
execution ID or rules fail with "No rules are configured".

- For first-party-dependencies: Update parent to the in-repo google-cloud-shared-config
  (1.22.0-SNAPSHOT) with relativePath and {x-version-update} tag, matching the
  configuration in sdk-platform-java-config and grpc-gcp-java.
- For gax-bom: Skip enforce-banned-duplicate-classes because it inherits a released
  version of google-cloud-shared-config (1.17.0) from Central to prevent cross-groupId
  (com.google.api vs com.google.cloud) publication-ordering issues.
@blakeli0
blakeli0 force-pushed the fix/ban-duplicate-classes-pom-modules branch from bd2d03a to 957f7bc Compare September 23, 2026 20:28
@blakeli0 blakeli0 changed the title ci: skip enforce-banned-duplicate-classes in gax-bom and first-party-dependencies ci: fix enforce-banned-duplicate-classes in first-party-dependencies and gax-bom Sep 23, 2026

This branch has not been deployed

No deployments
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.

1 participant