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

elharo commented on MNG-6036:
-----------------------------

I'm not sure I know enough about the Maven code base to say for sure at a code 
level. From a user perspective, I suggest that Maven 4.0 and possibly earlier 
make a hard break. Fully support namespaces and immediately reject any pom.xml 
file that is namespace malformed. All internal code depends only on the 
namespace URI + local name and never on the prefix or local name only.

 

There might be a way to use a new namespace to still accept old, malformed 
documents; but if so I'd want to think about how to limit that to previously 
published POMs only and prevent people from publishing new, broken ones. One 
way forward might be to implement a check on sonatype that prohibited the 
upload of malformed POMs. Indeed this could be implemented today without 
breaking any existing code though many POMs would have to be fixed before new 
versions could be uploaded.

> Allow proper namespace usage for pom.xml
> ----------------------------------------
>
>                 Key: MNG-6036
>                 URL: https://issues.apache.org/jira/browse/MNG-6036
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.9
>         Environment: Apache Maven 3.3.9 
> (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
> Maven home: /usr/local/Cellar/maven/3.3.9/libexec
> Java version: 1.8.0_40, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.11.4", arch: "x86_64", family: "mac"
>            Reporter: Roland Huss
>            Priority: Major
>
> When I use the following pom.xml in order to allow an XSD for my custom 
> plugin configuration:
> {code:xml}
> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>          xmlns="http://maven.apache.org/POM/4.0.0";
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/POM/4.0.0";>
> ....
>     <plugin>
>          ....
>          <m:configuration xmlns:m="http://maven.apache.org/POM/4.0.0"; 
> xmlns="http://fabric8.io/fabric8-maven-plugin";>
>              <myConfig>.....</myConfig>
>          </m:configuration>
>     </plugin>
>     ....
> </project>
> {code}
> I get this error:
> {code}
> [INFO] Scanning for projects...
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [ERROR] Malformed POM 
> /Users/roland/Development/docker/docker-maven-plugin/samples/data-jolokia-demo/pom.xml:
>  Unrecognised tag: 'm:configuration' (position: START_TAG seen 
> ...che.org/POM/4.0.0" xmlns="http://fabric8.io/fabric8-maven-plugin";>... 
> @91:117)  @ 
> /Users/roland/Development/docker/docker-maven-plugin/samples/data-jolokia-demo/pom.xml,
>  line 91, column 117
>  @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR]   The project io.fabric8:docker-jolokia-demo:0.15-SNAPSHOT 
> (/Users/roland/Development/docker/docker-maven-plugin/samples/data-jolokia-demo/pom.xml)
>  has 1 error
> [ERROR]     Malformed POM 
> /Users/roland/Development/docker/docker-maven-plugin/samples/data-jolokia-demo/pom.xml:
>  Unrecognised tag: 'm:configuration' (position: START_TAG seen 
> ...che.org/POM/4.0.0" xmlns="http://fabric8.io/fabric8-maven-plugin";>... 
> @91:117)  @ 
> /Users/roland/Development/docker/docker-maven-plugin/samples/data-jolokia-demo/pom.xml,
>  line 91, column 117 -> [Help 2]
> {code}
> It would be awesome if the XML parser would resolve namespaces properly. Its 
> not about adding namespace features, only for plain XML resolving (each 
> decent XML these days should be able to do this transparently).
> Except for 
> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
>  I couldn't find any statement when namespaces are supported or tolerated. 
> Are there any plans for this (and maybe also to relax the schema constraints 
> on the {{<configuration>}} tag)  ?
> See also https://github.com/rhuss/poblano/issues/19 for a use case.



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

Reply via email to