[ http://jira.codehaus.org/browse/MNG-1437?page=comments#action_83584 ] 
            
Ole Ersoy commented on MNG-1437:
--------------------------------

If EMF (Eclipse Modeling Framework) were used to load the pom, more elements 
could be added as needed without breaking anything.

I initially had issues using EMF to load the POM since some POMs are namespace 
qualified, and some not.

However, Ed Merks helped fix this and added some cool features in addition to 
make EMF more flexible with respect to namespaces:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=166127

So if EMF were used, the whole model would be generated from the XML Schema.

To change the model, simply update the xml schema, regenerate the corresponding 
EMF model, and then
generate the code for the model.

The model will still be backward compatible, as long as none of the existing 
schema definitions were changed and only additions were made.
Of coarse the additions need to be optional.

Also, EMF elegantly handles loading resources with different file extensions 
useing Resource Factories registering on a ResourceSet.

So for instance if the POM model were upgraded so that it became incompatible, 
one way of handling this would be to give the pom a different
file extension name.

So for instance
the version 4.00 of the pom could have extension pom4
version 5.00 could have extension pom5.

An EMF generated resource factory, based on the XML Schema for each model 
version, would be registered for each 
pom extension, and Maven could then load these poms.

If version 6 were added, simply generate the code, add the resource factory to 
the ResourceSet factories,
and Maven would now be able to load version 6 as well.







> How to make additions to the POM and have it be backward/forward compatible
> ---------------------------------------------------------------------------
>
>                 Key: MNG-1437
>                 URL: http://jira.codehaus.org/browse/MNG-1437
>             Project: Maven 2
>          Issue Type: Task
>          Components: Design, Patterns & Best Practices
>            Reporter: Jason van Zyl
>            Priority: Trivial
>             Fix For: 2.1
>
>
> I would like to add categories and site staging information to the POM but 
> don't want to break everything. Brett and I have discussed this topic briefly 
> but we need the XML parsing mechanism to be a bit more flexible or we may 
> just have to embrace namespaces to make this work ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to