Maven: why does it contain a seemingly broken schemaLocation?
In every maven pom.xml I've seen, the 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?
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.
上一篇: 在maven中下载存储库