As part of this release, Spring Boot was upgraded to 2.7.1 (Spring Framework version 5.3.21). This upgrade is optional and Broadleaf Microservices continues to be compatible with the previous Spring versions as well. If you wish to take the upgrade, you don’t need to do anything, as the default for the Broadleaf Microservices release train 1.7.3 includes the latest Spring dependencies. If you wish to continue to leverage the previous Spring dependencies, then a maven coordinates override is required (see below). Note, the latest version of Broadleaf dependencies not only includes the latest Spring features, but it also includes the latest in security updates. Keep this in mind if you choose not to take the latest Broadleaf dependencies release.
If you wish to override the default release train for 1.7.3 to include the legacy dependencies (pre-spring-upgrade), then you’ll need to create a pom that inherits from the release train and override several maven properties to adjust the versions. An easy way to achieve this is to include a new maven module in your project.
-
Create a new directory in your project. Name it dependencies
.
-
Inside that directory, create a new pom.xml file. Add the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.broadleafcommerce.microservices</groupId>
<artifactId>broadleaf-microservices-release-train</artifactId>
<version>1.7.3-GA</version>
<relativePath />
</parent>
<groupId>com.broadleafdemo</groupId>
<artifactId>release-train-override</artifactId>
<name>release-train-override</name>
<description>Override dependency BOM versions in the release train BOM</description>
<packaging>pom</packaging>
<version>[[ PUT YOUR PROJECT VERSION HERE ]]</version>
<repositories>
<repository>
<id>broadleaf-microservices</id>
<url>https://repository.broadleafcommerce.com/repository/microservices/</url>
</repository>
</repositories>
<properties>
<broadleaf.base.dependencies.version>1.7.4-GA</broadleaf.base.dependencies.version>
</properties>
</project>
In this case, 1.7.4-GA for the base dependencies is the version prior to the spring upgrade.
<modules>
<module>dependencies</module>
<module>helpers</module>
<module>services</module>
<module>flexpackages</module>
...
</modules>
-
Finally, in the dependencyManagement
element of your project’s base pom, comment out the broadleaf-microservices-release-train
dependency to disable it. Then add in your override instead. For example:
<dependencyManagement>
<dependencies>
<!--
<dependency>
<groupId>com.broadleafcommerce.microservices</groupId>
<artifactId>broadleaf-microservices-release-train</artifactId>
<version>${blc.release.train}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
...
<dependency>
<groupId>com.broadleafdemo</groupId>
<artifactId>release-train-override</artifactId>
<version>[[ PUT YOUR PROJECT VERSION HERE ]]</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>