You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slachiewicz (via GitHub)" <gi...@apache.org> on 2026/10/09 21:24:57 UTC

[PR] Treat a model built from a POM file as the project, whatever its validation level [maven]

slachiewicz opened a new pull request, #13394:
URL: https://github.com/apache/maven/pull/13394

   Fixes #13347.
   
   The repository-model restrictions from #12953 (interpolation) and #13114 (profile activation sandbox) decided "this POM came from a repository" by `validationLevel < VALIDATION_LEVEL_MAVEN_2_0` alone. IDEs build the user's own project from its POM file at `VALIDATION_LEVEL_MINIMAL` for leniency (NetBeans `MavenEmbedder.readProjectWithDependencies`, m2e `MavenImpl.readProject`), so their projects were sandboxed: `-D` profile activation stopped working, and `maven.model.dependencyInterpolation.full` only restored the interpolation half (apache/netbeans#9642).
   
   Both checks now also require `getPomFile() == null`. `ModelBuildingRequest.setPomFile` already documents a POM file as project mode, and the repository paths never set one: `DefaultArtifactDescriptorReader` sets it only for `WorkspaceRepository` POMs, BOM imports use `setModelSource`, and `DefaultProjectBuilder.build(Artifact)` passes a POM file only for a project in the reactor. Callers that set neither keep the validation-level fallback, so nothing changes for the CLI or for repository resolution. No API change.
   
   master needs the equivalent change in the v3 bridge (`DefaultProjectBuilder` request type); that will be a separate forward-port.
   
   Verified: `mvn -pl maven-model-builder,maven-resolver-provider,maven-core -am install` → BUILD SUCCESS (maven-core 402 tests). With the main-code change reverted, the new `testProjectModeAtMinimalValidationEvaluatesUserPropertyAndFileActivators` fails (`expected: <activated> but was: <null>`). The core ITs covering the hardening (MavenIT0085, mng3586, mng4379, mng4590) have not been run locally.
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Treat a model built from a POM file as the project, whatever its validation level [maven]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #13394:
URL: https://github.com/apache/maven/pull/13394#issuecomment-6321849284

   Why is this draft? Any special reason?


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Treat a model built from a POM file as the project, whatever its validation level [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #13394:
URL: https://github.com/apache/maven/pull/13394#issuecomment-6154403638

   _Fully automatic review from Claude Code_
   
   This PR (#13394, fixing #13347) and #13451 (fixing #13390) are complementary fixes to the same `externalActivationContext` sandbox on `maven-3.10.x`:
   
   - **This PR** fixes the IDE case: embedders building their own project from a POM file at `VALIDATION_LEVEL_MINIMAL` should not be sandboxed. Adds `getPomFile() == null` check to `isExternalModelBuildingRequest()`.
   - **#13451** fixes POM self-activation: a dependency POM's `<properties>` should not activate its own property-based profiles. Removes the POM-property merge from `externalActivationContext()`.
   
   Both are needed. The production code changes are in different methods and merge cleanly. There will be a **textual conflict in `ResolvedDependencyProfileActivationTest.java`** since both PRs modify and add tests in the same file — trivial to resolve on rebase.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Treat a model built from a POM file as the project, whatever its validation level [maven]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz merged PR #13394:
URL: https://github.com/apache/maven/pull/13394


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org