Skip to content

Commit

Permalink
chore: upgrade to Spring Boot 3
Browse files Browse the repository at this point in the history
Spring Boot 3 made some changes to the way a library, such as this one,
notifies Spring Boot that it wants to be autoconfigured.

[Details of this change are in the release notes of version 2.7][1].

With this commit, a new versioning system for this package is proposed:
`<Spring Boot version>-<tradition semantic versioning>`. For example,
`3-1.0.2`. Why? The problem with only semantic versioning _and_
following Spring releases (especially those with breaking changes) is,
that it becomes unclear when to update to a new major version. Should we
do it when this library introduces a breaking change? Or when Spring
Boot does? To solve this, the version now consists of a leading digit,
indicating the Spring Boot version that this version works with,
followed by a semantic version of the library itself.

So, we now have `2-1.0.2`, working with Spring Boot 2, alongside
`3-1.0.2`, which works with Spring Boot 3. When a breaking change is
made to this library, we would signal that by bumping the versions to
`2-2.0.0` and `3-2.0.0`, respectively.

[1]: <https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes#changes-to-auto-configuration>
  • Loading branch information
svandenakker committed Mar 13, 2024
1 parent ee5a9c5 commit c35a860
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<artifactId>cryptvault</artifactId>
<packaging>jar</packaging>
<name>cryptvault</name>
<version>1.0.2</version>
<version>3-1.0.2</version>
<description>Versioned crypto library</description>
<url>https://github.com/bolcom/cryptvault</url>

Expand Down Expand Up @@ -43,26 +43,26 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.4.0</version>
<version>3.2.3</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.4.0</version>
<version>3.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.18.1</version>
<version>3.25.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bol/config/CryptVaultAutoConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.bol.config;

import com.bol.crypt.CryptVault;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.Base64;
import java.util.List;

@Configuration
@AutoConfiguration
@ConditionalOnProperty("cryptvault.keys[0].key")
public class CryptVaultAutoConfiguration {

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/META-INF/spring.factories

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.bol.config.CryptVaultAutoConfiguration

0 comments on commit c35a860

Please sign in to comment.