gnodet commented on issue #8424:
URL: https://github.com/apache/maven/issues/8424#issuecomment-6274245492
After further analysis, I'm closing this issue — there is no simple solution.
**What PR #13406 attempted:** inject profile-scoped properties under the
`profile.<id>.<key>` namespace, allowing `${profile.scala-2.11.scala.version}`
to resolve to `2.11` even when both profiles are active simultaneously.
**Why it doesn't meaningfully solve the use case:** the original request is
that a shared plugin configuration references `${scala.version}` and produces
two separate executions — one per active profile value. This requires Maven to
interpolate each profile independently, in its own property context, before
merging them into the model. That is not what happens today: Maven merges all
active profiles into a single model first, then interpolates once. At that
point, the provenance of each property is lost.
With `profile.<id>.<key>`, each profile must still declare its own
`<execution>` block referencing its own scoped property explicitly. The
verbosity is identical to today's workaround (hardcoding the ID and value). The
only marginal gain is when the same property is referenced in multiple places
within a profile — a minor benefit that doesn't justify the cost:
- A reserved `profile.*` namespace injected into model properties for every
active profile
- Ambiguity when profile IDs contain dots
- Non-obvious syntax that users are unlikely to discover
**The real fix** would require interpolating each profile independently
before merging — a significant refactoring of the model builder with broad
impact. There is no appetite to pursue this at this time.
Closing as Won't Fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]