Maven does not comply to XML rules regarding prefixes.
------------------------------------------------------
Key: MNG-2714
URL: http://jira.codehaus.org/browse/MNG-2714
Project: Maven 2
Issue Type: Bug
Environment: Ubuntu 6.10
Maven 2.0.4
Reporter: Seva Safris
Priority: Critical
I am new to Maven and have been trying to learn how to create a simple project.
Let me walk through my scenario of creating a pom.xml file:
1. I bind the {http://maven.apache.org/POM/4.0.0} namespace (defined at
"http://maven.apache.org/maven-v4_0_0.xsd") to Java classes using an XML
Binding solution.
2. I use the bound classes to create a simple <project/> as one would expect to
see in a pom.xml file.
3. I marshal the bound Java objects into xml and write it into pom.xml. Here is
the xml I use:
<ns1:project
xmlns:ns1="http://maven.apache.org/POM/4.0.0">
<ns1:modelVersion>4.0.0</ns1:modelVersion>
<ns1:groupId>com.myapp</ns1:groupId>
<ns1:artifactId>sample-project</ns1:artifactId>
<ns1:name>Sample Maven Project</ns1:name>
<ns1:version>1.0</ns1:version>
<ns1:developers>
<ns1:developer>
<ns1:id>ssafris</ns1:id>
<ns1:name>Seva Safris</ns1:name>
</ns1:developer>
</ns1:developers>
<ns1:build>
<ns1:sourceDirectory>${basedir}/src/java</ns1:sourceDirectory>
</ns1:build>
</ns1:project>
4. I run mvn, and am promptly given a "Not a v4.0.0 POM." exception.
Tracing through Maven's source, I went to the exact location of the exception
in DefaultMavenProjectBuilder.java. On line 1297 it has:
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira