Apache Software Foundation / Maven Core
Merged upstreamCorrectnessMerged Sep 22, 2026

Recognize injected parent profiles during validation

Included profile IDs already injected into the effective model when Maven validates requested profiles, while retaining errors for genuinely missing profiles.

apache/maven · #13205

Maven 4 regression fix

Projects can validate active profiles inherited from a parent even when the parent MavenProject is unavailable in a clean local repository.

Problem

The effective model could contain an active parent profile while profile validation searched only the available project hierarchy. With an empty local repository, the parent MavenProject could be absent and Maven incorrectly rejected the valid profile.

Approach

Extends validation with MavenProject injected-profile metadata, limiting recognition to profiles that actually contributed to the effective model rather than accepting arbitrary requested names.

Impact and scope

  • Restores clean-repository builds for projects that activate inherited parent profiles under Maven 4.
  • Preserves failure behavior for truly nonexistent required profiles and avoids weakening profile validation globally.
  • Uses existing effective-model provenance instead of adding repository lookups or changing profile activation semantics.

Validation

  • The regression failed before the change and passed after it; a patched Maven build validated the affected Jenkins text-finder project against an empty local repository.
  • The focused integration suite covered all five scenarios, including continued failure for an actually nonexistent profile, and broader Core IT covered 88 modules.
  • All 20 hosted checks passed, the linked issue is closed, and the verified merge commit credits Goutam Adwant.