Jesse,

I don't agree with your analysis.

My view is as follows:

1) POM5 should have strategically located xs:any and xs:anyAttribute
elements that give tools fair warning of future extensions. I wish
POM4 had them, but such is life. As things are, the community seems in
general to be comfortable with a small risk of breaking some fragile
tools by making small changes to POM4.

2) Adding explicit elements next to xs:any is a far more user-friendly
extensibility mechanism than creating a hodgepodge of namespaces and
prefixes.

3) I understand the theoretical advantage in correctness of changing
the schema URI for each new version, but I question the practical
utility. I can't think of a use case in which it actually helps
anything.

--benson


On Tue, Aug 2, 2011 at 8:00 AM, Jesse Glick <[email protected]> wrote:
> On 07/31/2011 05:12 PM, Benson Margulies wrote:
>>
>>
>> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
>
> "It would [...] be a bad idea to try to use namespaces as a versioning
> technique." - if you want to allow Schema validation of the entire POM, I
> think you have to do this. Otherwise you cannot add new (optional) elements
> - lest older versions of Maven or plugins be confused by them - or remove
> obsolete elements - lest older POMs suddenly fail to validate. Code building
> a model from a range of versioned namespaces could choose to have a single
> model for all of them, if the differences are minor and easily dealt with in
> small if-then blocks, or could define new models for major revisions; this
> is awkward but probably no worse than handling "undeclared" changes to an
> existing schema.
>
> Anyway having to type <modelVersion>4.0.0</modelVersion> is no better than
> xmlns="http://maven.apache.org/POM/4.0.0";, I think. At least the latter
> means that a Schema-aware XML editor/IDE can assist you.
>
> What _is_ bad in Maven currently (at least as of 3.0.3) is that whereas
> modelVersion is required, you are permitted to write the POM with no
> namespace declaration at all. This means that any code inspecting or
> modifying a POM has to have a (rarely used) code branch to deal with
> no-namespace elements, which is cumbersome.
>
> Worse, Maven seems to have a different idea of what valid content is than
> the schema says. For example, the schema says <xs:element
> name="modelVersion" minOccurs="0" ...> but Maven will report "'modelVersion'
> is missing." as a fatal error. Certainly there will be some semantic
> constraints that XML Schema cannot capture - e.g. <groupId> can be omitted
> from <project> if <parent> specifies it - but these ought to be minimized.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to