[
https://issues.apache.org/jira/browse/MNG-8141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17853552#comment-17853552
]
ASF GitHub Bot commented on MNG-8141:
-------------------------------------
gnodet commented on PR #1569:
URL: https://github.com/apache/maven/pull/1569#issuecomment-2157408570
> @gnodet also, re caching, I think you are wrong (so resolver does _builds_
same model for same GAV asked for different GACEVs), I mean it DOES cache raw
models, but lineage, normalization, profile evaluation etc... all that is
repeated (basically only XML parsing from file is spared). But am really unsure
"who's fault" is this: resolver or ArtifactDescriptorReader?
>
> EDIT: Am pretty much sure ArtifactDescriptorReader is it. Resolver itself
is "agnostic" (no idea about Maven universe), and even have no (and should not
have) logic that tells "POM of a Maven GACEV artifact is on coordinates
GApomV". Moreover, this indirection is done in ArtifactDescritptorReader as
that is _Maven specific implementation of ArtifactDescriptorReader resolver
component_.
Right, only file and raw models are cached, but even if the effective model
is computed twice, no resolver request / disk access should be performed, as
it should start from the already loaded raw model.
> Model Builder should report if not sure about "fully correct" outcome
> ---------------------------------------------------------------------
>
> Key: MNG-8141
> URL: https://issues.apache.org/jira/browse/MNG-8141
> Project: Maven
> Issue Type: Improvement
> Components: Core
> Reporter: Tamas Cservenak
> Assignee: Tamas Cservenak
> Priority: Major
> Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4
>
>
> ModelBuilder is component building models (POM + interpolating + parent
> inheritance and many many more things), but it should not rely that built
> model "was validated", as it MAY NOT been validated: for "furthest" models it
> builds, like a parent of a some-level-dependency we use MIN level of
> validation (minimal validation).
> Still, while the model builder builds, it relies on several aspects of the
> model, and it should ensure that the "output" (built model) is correct. Model
> Builder hence must be changed in way, that IF it detects any issue _during
> building_ of the model, and IF it appears with even slightest possibility
> that it cannot deliver "correct output", it must add WARNs to model building
> result with proper messages.
> One typical case is when model building injects activated profiles (as they
> can deliver properties and extra plugins and what not) and activation code
> detects a "problem", like for example duplicated profile IDs being used (this
> IS catched by validation, but not on MIN level!), hence, model builder cannot
> guarantee that built model IS correct.
> This change is really only to make Maven emit WARNINGs if project being built
> has some "far POMs" (like parent pom of a dependency of a first level
> dependency, as in reproducer). If model builder cannot be "100% sure" it
> built model correctly, it should be reported. Moreover, WARNs of model
> building result were simply neglected so fat (lost). Having warnings like
> these would reveal "invalid parent POM" early, as it is case in issue
> MNG-8131 for example.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)