I'm using 2.2.x and was surprised to find that, while valid XML, the following
are not valid in a pom.xml:

    <modelVersion> 4.0.0 </modelVersion>

or
    
    <modelVersion> 
        4.0.0
    </modelVersion>

I had expected that the maven xml parser would be normalizing the whitespace,
but looked in
maven-2.2.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
and found this in readModel(), line 1609:

        if ( modelSource.indexOf( "<modelVersion>" + MAVEN_MODEL_VERSION ) < 0 )
        {
            throw new InvalidProjectModelException( projectId, pomLocation, 
"Not a v" + MAVEN_MODEL_VERSION  + " POM." );
        }

Why is the parser hand-parsing this piece of the XML instead of looking at the
child content and normalizing/trimming whitespace? It's counterintuitive to me
as a user, since the POM XSD decalres modelVersion to be xs:string and there is
no mention anywhere that I'm not allowed to use whitespace.

jon

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

Reply via email to