Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven: why does it contain a seemingly broken schemaLocation?

Tags:

maven

pom.xml

In every pom.xml I've seen, xsi:schemaLocation is specified like this:

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                    http://maven.apache.org/xsd/maven-4.0.0.xsd"

Example: https://maven.apache.org/pom.html.

The second URL is a valid XSD. What is the purpose of the first URL? http://maven.apache.org/POM/4.0.0 returns a "page not found" error.

Is there another purpose to this seemingly broken URL?

like image 946
Mark Harrison Avatar asked Nov 13 '15 05:11

Mark Harrison


1 Answers

This attribute has two values, separated by a space. The first value is the namespace to use. The second value is the location of the XML schema to use for that namespace. Which means the first part is not a real URI and can not be accessed, cause it's the namespace within the XSD and the second one is the XSD definition which can be used to check the xml file.

So this means in result there is no broken schema. It is correct.

like image 94
khmarbaise Avatar answered Sep 16 '22 14:09

khmarbaise