This is a quick blog that provides a few pointers about converting your existing projects and providing a few links to some of the more detailed information.
Useful ResourcesTwo useful resources I’ve found are:
The Spring Upgrade Guide and the Spring Reference Documentation.
There are a couple of points to note about the release of Spring 3. Firstly, they’ve provided a Spring release strategy that more closely fits into the Maven build philosophy. This means ditching the colossal
spring.jarfile and splitting the code down into a number of smaller modules. A list of these modules is available in both the upgrade guide and the reference manual.
When updating your Maven pom files, if you haven’t done so already, you’ll need to remove references to:
<groupId>org.springframework</groupId> <artifactId>spring</artifactId>You’ll then need to add in the new Spring Maven modules and set their version to: ‘3.0.5.RELEASE’
You must also ensure that Spring 2 is not on the classpath; this can be difficult if you’re using a super-pom hierarchy over which you have little control. If Spring 2 is accidentally left on the classpath, then you’ll see on initialization
MalformedParameterizedTypeExceptionoccurring. You can ensure that Spring 2 is not on the classpath by adding the following dependency exclusion:
<dependency> <groupId>my.project.group.id</groupId> <artifactId>my.artifact.id</artifactId> <type>jar</type> <version>3.1</version> <exclusions> <exclusion> <!-- we're using newer Spring 3 --> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions> </dependency>
SchemasYou can update your XML configuration files to use Spring 3 schemas (XSD); however, the old Spring 2 schemas and will still work.
Version 3 'Basic' Schema inclusion
<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-3.0.xsd">... of course you need to add in further schema locations as necessary...