Skip to content

ci: skip enforce-banned-duplicate-classes in non-jar POM modules - #14272

Merged
lqiu96 merged 1 commit into
mainfrom
fix-ban-duplicate-classes-skip
Sep 4, 2026
Merged

ci: skip enforce-banned-duplicate-classes in non-jar POM modules#14272
lqiu96 merged 1 commit into
mainfrom
fix-ban-duplicate-classes-skip

Conversation

@lqiu96

@lqiu96 lqiu96 commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

Fixes No rules are configured errors encountered in the ban-duplicate-classes workflow on POM-only modules.

Background

In #14142, the enforcer 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 immediately on:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.6.3:enforce (enforce-banned-duplicate-classes) on project native-image-shared-config: No rules are configured. Use the skip flag if you want to disable execution.

Changes

Added an explicit <execution> for <id>enforce-banned-duplicate-classes</id> with <skip>true</skip> to:

  • java-shared-config/native-image-shared-config/pom.xml: configuration-only parent POM
  • java-shared-config/pom.xml: aggregator parent POM
  • java-cloud-bom/tests/dependency-convergence/pom.xml: standalone BOM test module (preserving its upper-bound deps check in the enforce execution)

Verification

  • Verified mvn -B -ntp enforcer:enforce@enforce-banned-duplicate-classes passes in java-shared-config.
  • Verified mvn -B -ntp enforcer:enforce@enforce passes in java-shared-config.
  • Verified mvn -B -ntp enforcer:enforce@enforce-banned-duplicate-classes passes in java-cloud-bom.
  • Verified mvn -B -ntp enforcer:enforce@enforce passes in java-cloud-bom.

In #14142, 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".

Add an explicit skip execution for enforce-banned-duplicate-classes in:
- native-image-shared-config: configuration-only parent POM
- google-cloud-shared-config-parent: aggregator parent POM
- full-convergence-check: standalone BOM test module
@lqiu96
lqiu96 requested review from a team as code owners September 4, 2026 18:31

@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 across multiple pom.xml files, including java-cloud-bom/tests/dependency-convergence/pom.xml, java-shared-config/native-image-shared-config/pom.xml, and java-shared-config/pom.xml. I have no feedback to provide as there are no review comments.

@lqiu96
lqiu96 requested a review from blakeli0 September 4, 2026 18:52
@lqiu96
lqiu96 merged commit e6ce2b7 into main Sep 4, 2026
239 checks passed
@lqiu96
lqiu96 deleted the fix-ban-duplicate-classes-skip branch September 4, 2026 21:53
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