gnodet commented on code in PR #1147:
URL: https://github.com/apache/maven/pull/1147#discussion_r1220991189
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -2646,6 +2646,15 @@
]]>
</description>
</field>
+ <field>
+ <name>priority</name>
+ <version>4.2.0+</version>
Review Comment:
Not at all.
This element can not be removed if present in a POM, as this will change the
semantics of the POM. The build/consumer POM is all about inferred (or removal
of unused) data. If we were to upload a project which defines such a new
element/attribute but use it with a maven version that does not know about it,
the build results could be different and that would be bad. So I don't think
we should upload a POM stripped of this element.
So I think a new POM is needed for that one. 4.1.0 is kinda used internally
for the api v4 migration, so I went with 4.2.0. This field is a bit specific
as it does already exist in the 4.0.0 model, but it is flagged as
`xml.transient=true`, which means it is not read from the xml, but there's a
field + getter/setter already generated.
On the compatibility side, I think this defines a new 4.2.0 POM. Note that
the way the xml reader is generated, it has two modes: the first mode when
reading projects being built where a strict validation is used, i.e. any
unknown element will be rejected and cause a parsing failure. When using this
mode, i.e. when building a project with a 4.2.0 `modelVersion`, maven 3.x will
reject it. However, if uploaded on maven central and used as a dependency, the
lenient parsing mode is used, where any unknown element or attribute is simply
ignored (see the `checkUnknownElement` and `checkUnknownAttribute` of the
`MavenXpp3Reader`). That will mean that projects with a modelVersion of 4.2.0
will be able to be consumed by older maven 3.x tools / projects.
--
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]