[ 
https://issues.apache.org/jira/browse/MNG-6830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17255628#comment-17255628
 ] 

Michael Osipov commented on MNG-6830:
-------------------------------------

The Modello model allows to define versions on element, but one cannot say that 
element came to existence in schema version 1.1.0 and and is backward 
compatible. Consider the following in settings which is a real usecase we are 
discussion at the moment:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"; 
xmlns:settings-1.2.0="http://maven.apache.org/SETTINGS/1.2.0";>
<mirrors>
        <mirror>
                <!--  -->
        </mirror>
</mirrors>

<settings-1.2.0:repositories>
        <settings-1.2.0:repository>
                <!--  -->
        </settings-1.2.0:repository>
</settings-1.2.0:repositories>
</settings>
{code}

This is the only proper way to do this in XML. With this approach pre-4.0.0 
Maven clients can safely ignore new settings while new ones can read, but this 
would also mean that the parser tries to read elements with every compatible 
schema version. Alternatively, it is all or nothing. Everything 1.1.0 or 1.2.0, 
no mixed case, but still when 1.3.0 or 2.0.0 comes you will fail again....

[~elharo] is the expert, I leared from him.

> Warn on missing namespace
> -------------------------
>
>                 Key: MNG-6830
>                 URL: https://issues.apache.org/jira/browse/MNG-6830
>             Project: Maven
>          Issue Type: Improvement
>            Reporter: Elliotte Rusty Harold
>            Priority: Minor
>
> We allow pom.xml files with no namespace and reject pom.xml files that use 
> prefixed local names that are correctly namespaced.
> As step 1 to getting to a release where we can fix this, emit a warning when 
> we encounter a non-namespaced pom.xml such as this:
> <project>
>   <modelVersion>4.0.0</modelVersion>
>   <packaging>war</packaging>
>   <version>0.1.0-SNAPSHOT</version>
>   <groupId>c.g</groupId>
>   <artifactId>mvn25</artifactId>
>   <properties>
>     <appengine.maven.plugin.version>2.2.0</appengine.maven.plugin.version>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
>     <maven.compiler.source>1.8</maven.compiler.source>
>     <maven.compiler.target>1.8</maven.compiler.target>
>     <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
>   </properties>
> </project>



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to