Maven: why does it contain a seemingly broken scheme?

In every maven pom.xml I saw, xsi: schemaLocation is listed as follows.

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 an error "page not found".

Is there any other purpose for this seemingly broken URL?

+5
source share
1 answer

This attribute has two values, separated by a space. The first value is the namespace. The second value is the location of the XML schema used for this namespace. This means that the first part is not a genuine URI and cannot be accessed because it is a namespace in XSD, and the second is an XSD definition that can be used to validate an xml file.

So this means that as a result there is no broken schema , this is correct.

+1
source

Source: https://habr.com/ru/post/1235855/


All Articles