The only solution is to do what is already done actually...

1) We can't have a schema more restrictive because each element is optional if 
you use the POM's inheritence.
2) We can't easily merged project.xml files because there are several rules : 
some elements replace the ones in the parent and some
others are in addition to them (and it will as complicated as the 3rd proposal).
3) We can't test the rewritten POM because it will not be easy to explain to 
the user where the problem is ...

The real question we should ask to ourselves it's why we need a schema for the 
POM ?
After thinking about it I'm not sure it's a good idea to validate the POM with 
a schema :-(
The schema (in my opinion) should be used exclusively to help users to create 
the project.xml file (using an xml editor which
propose it if they don't already use a tool like mevenide).
The validation of the POM should be done by the core itself (with a validate 
method in the Project object -even if I don't know what
we can test) and an explicit message should be return if there's a problem. ==> 
It should be also the model which log a message if a
plugin tries to use an element in the POM which is not defined (The test 
shouldn't be done in the plugin) ....

But I think that all these ideas aren't possible to implement to keep the 
compability between maven 10 and maven 1.1 :-(
Thus I think we must keep things as more simple as possible.

WDYT ?

Arnaud



> 
> The real POM has to be checked against a schema, that's sure. 
> If we want to check also the generated model I'm ok with 
> that, but as a new feature (sanitity test).
> 
> On 10/6/05, Lukas Theussl <[EMAIL PROTECTED]> wrote:
> >
> > I am a bit sceptical about that. I don't know in detail how the 
> > PomRewriter class works but it constructs a new pom from a 
> maven model.
> > That means it gets transformed on the way, I did a few tests and 
> > noticed that attributes get stripped, the order of elements 
> changed, ...?
> >
> > It would be safer to have a simple node-by-node merge of 
> xml files, I 
> > don't know if there exists a convenient tool for this.
> >
> >
> > But then, with a merged pom it would be hard to track 
> errors since we 
> > don't know where a particular error came from...
> >
> > Any thoughts?
> >
> > Lukas
> >
> >
> >
> > Arnaud HERITIER wrote:
> > > Actually, it's the real POM which is tested, thus it's 
> not possible to add a minimum set of elements.
> > > But I just finished to commit a new tag in the artifact 
> plugin which 
> > > allow to generate an aggregated pom which resolves 
> inheritence, jelly variables, versions override, and we could 
> use it to test the POM.
> > >
> > > WDYT ?
> > >
> > > Arnaud
> > >
> >
> >
> > 
> ---------------------------------------------------------------------
> > 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]
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to