You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by sk...@riege.de on 2003/06/03 12:17:56 UTC

maven project xml schema buggy?

Hi gurus,

[possibly this is a issue for dev-list?]

just trying to use the maven-project.xsd Schema for my project.xml's...

1. I don't know xml schema well, but my editor (jEdit) was not able to check 
against the schema until I changed

<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>

into 

<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http:
//my.com/maven' xmlns="http://my.com/maven" elementFormDefault="qualified" 
attributeFormDefault="unqualified" >

and then I changed project.xml from 

<project>...

to

<project xmlns="http://my.com/maven" xmlns:xsi="http://www.w3.
org/2001/XMLSchema-instance" xsi:schemaLocation="http://my.com/maven 
maven-project.xsd">...

My question: Is the maven project schema buggy since it misses the 
targetNamespaces and xmlns ???

Should one update the docs?


2. I used inheritance for my subprojects to ommit the pomVersion, organisation 
etc. tags in my sub-project POM files.  This does not harmonise with the schema, 
since the schema requires pomVersion, organisation, etc. 
Any idea how this conflict could be solved???

After all my rethinking of the problem I finally think it's best either to 
not-use schema for those subprojects or to copy the required and redundant 
information in all sub-project POMs.  What are you guys thinking?

Cheers,
Martin

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven project xml schema buggy?

Posted by "Mark H. Wilkinson" <mh...@kremvax.net>.
On Tue, 2003-06-03 at 11:17, skopp@riege.de wrote:
> 1. I don't know xml schema well, but my editor (jEdit) was not able to check 
> against the schema until I changed

Coincidentally, I just tried to do the same thing with some of my
project.xml files. I think someone mentioned 'maven pom:validate'
yesterday, which checks project.xml against the schema and seems to work
with the schema file in CVS at the moment. This might simply mean that
jEdit's schema validator is more strict than maven's, though...

> 2. I used inheritance for my subprojects to ommit the pomVersion, organisation 
> etc. tags in my sub-project POM files.  This does not harmonise with the schema, 
> since the schema requires pomVersion, organisation, etc. 
> Any idea how this conflict could be solved???
> 
> After all my rethinking of the problem I finally think it's best either to 
> not-use schema for those subprojects or to copy the required and redundant 
> information in all sub-project POMs.  What are you guys thinking?

Yeah, I ran into the same problem. I don't want to copy redundant
elements into the subproject POM just to satisfy the schema - it comes
down to the schema actually being too strict for files that use POM
inheritance.

One way out (don't know if it's the only way) would be to relax the
schema validation checks for POMs that use <extend>, then to perform
more of the validation on the project model itself (i.e. the Java
objects after they've been loaded into memory). Ideally this could still
be driven from the XML Schema, but you'd need something to bind the XML
Schema model to the Java model and perform the validation. Probably
easier to just write the rules in Java.

-Mark.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org