Spring configuration files and schema versioning

It seems you cannot specify version numbers in spring configuration files:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

So, is spring coming to the latest version in the classpath? Where is this in the spring docs, if any at all?

+5
source share
3 answers

In spring - beans.jar there is a spring.schemas file. This file contains pointers to XSD files. Here is the value in spring.schemas file.

http\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd

Therefore, the file is in the package org.springframework.beans.factory.xml of the container.

+4
source

You absolutely can specify the version: http://www.springframework.org/schema/beans/

Click the link, it lists all available XSDs with the version.

However, an inverted XSD always indicates the latest version.

+3

So, is Spring coming to the latest version in the classpath?

Essentially, yes. This allows your configuration files to supposedly be versioned, mainly for reasons of advanced compatibility.

Where is this in the Spring docs, if any at all?

I do not think so.

0
source

All Articles