9

Can anyone please let me know if the Spring 5 version of XSDs are available?

Is there something like spring-beans-5.1.xsd, spring-context-5.1.xsd, spring-mvc-5.1.xsd or spring-beans-5.0.xsd, spring-context-5.0.xsd, spring-mvc-5.0.xsd available in Spring ?

If available, please provide the links for those XSDs.

Also, can anyone let me tell what is the compatible version of spring-security for Spring 5.x?

Anish B.
  • 9,111
  • 3
  • 21
  • 41
user1179752
  • 241
  • 2
  • 4
  • 10

1 Answers1

3

There is no XSD available for Spring 5.


Note: Instead of providing the explicit version of XML schema better go for the generic XML schema which can support any version of spring.


XSD version support list :

For spring-mvc :

For spring-context :

For spring-beans:


So, I would recommend you to go for generic XSDs because this reduces the confusion to pick which XSD version for Spring version that you are using.

Just an example :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd">
     
    <!-- Bean declaration and other configurations -->
     
</beans> 

Let's say if you are using spring-core 5.0.4.RELEASE, then compatible version of spring-security is 5.0.2.RELEASE.

If maven project, then add these dependencies in pom.xml :

<dependencies>
   <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>5.0.2.RELEASE</version>
   </dependency>
   <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>5.0.4.RELEASE</version>
   </dependency>
   <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>5.0.4.RELEASE</version>
   </dependency>
   <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.0.4.RELEASE</version>
   </dependency>
   <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>5.0.4.RELEASE</version>
   </dependency>
   <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>5.0.4.RELEASE</version>
   </dependency>
</dependencies>

How to check which version of spring security is supported by spring-core, spring-beans, spring-context & so on ?

  1. Open https://mvnrepository.com

  2. Type spring security in the search box

  3. Press enter.

  4. Click on spring security core.

enter image description here

  1. Click on the version that you want to use. Let's say I have opened 5.0.2.RELEASE, then see for compile dependencies. It will show the list of library that it supports.

enter image description here

  1. See for the version of spring-beans, spring-context & so on.

Or

If it's a normal project, then download jar from https://mvnrepository.com and add the appropriate spring jars needed in your project.

Or

You can download Spring version jar zip (all in one) from here: https://repo.spring.io/release/org/springframework/spring/

Extract it and add all the jars to your project on the classpath.

Anish B.
  • 9,111
  • 3
  • 21
  • 41
  • Thanks Anish. But we have the below links for spring 3.0, spring 4.2 xsd's http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans/spring-beans-4.2.xsd My XML files has the bean definitio as below. – user1179752 Oct 05 '18 at 09:47
  • Thanks Anish. But we have the below links for spring 3.0, spring 4.2 xsd's http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans/spring-beans-4.2.xsd I could not find similar links for spring 5 xsd's My XML files has the bean definition as below. `xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"` Need to replace this 4.2 with 5.0 – user1179752 Oct 05 '18 at 09:58
  • Can we get similar links for spring 5 xsd's – user1179752 Oct 05 '18 at 10:19
  • 2
    I found upto 4.3 XSD. xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd There is no spring xsd for 5.0. – Anish B. Oct 05 '18 at 10:45
  • I have updated my answer. Please guys have a look. – Anish B. Jan 17 '21 at 13:10
  • Should it be `http` or `https`? – wonsuc Jan 03 '23 at 05:43
  • 1
    @wonsuc It will be http – Anish B. Jan 03 '23 at 07:12