Repository navigation
ci: skip enforce-banned-duplicate-classes in non-jar POM modules - #14272
Merged
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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.
blakeli0
approved these changes
Sep 4, 2026
blakeli0
added a commit
to blakeli0/google-cloud-java
that referenced
this pull request
Sep 23, 2026
…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
added a commit
that referenced
this pull request
Sep 28, 2026
…and gax-bom (#14492) ## 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
No rules are configurederrors encountered in theban-duplicate-classesworkflow on POM-only modules.Background
In #14142, the enforcer was split into:
enforce(fast metadata rules for PRs)enforce-banned-duplicate-classes(runsbanDuplicateClasseson release branches viamvn -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. Becausemaven-enforcer-pluginrequires at least one rule (orskip=true), this caused theban-duplicate-classesjob to fail immediately on: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 POMjava-shared-config/pom.xml: aggregator parent POMjava-cloud-bom/tests/dependency-convergence/pom.xml: standalone BOM test module (preserving its upper-bound deps check in theenforceexecution)Verification
mvn -B -ntp enforcer:enforce@enforce-banned-duplicate-classespasses injava-shared-config.mvn -B -ntp enforcer:enforce@enforcepasses injava-shared-config.mvn -B -ntp enforcer:enforce@enforce-banned-duplicate-classespasses injava-cloud-bom.mvn -B -ntp enforcer:enforce@enforcepasses injava-cloud-bom.