Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Spring Boot 3 #1104

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [1.8]
boot: [2.7.0, 2.7.12]
java: [ 17 ]
boot: [ 3.1.0, 3.1.3 ]
fail-fast: false

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [1.8, 11]
java: [ 17 ]
fail-fast: false

steps:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- uses: jfrog/setup-jfrog-cli@v3
with:
version: 2.39.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mongodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [1.8, 11]
java: [ 17 ]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [1.8, 11]
java: [ 17 ]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [1.8, 11]
java: [ 17 ]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-ga.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- uses: jfrog/setup-jfrog-cli@v3
with:
version: 2.39.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- uses: jfrog/setup-jfrog-cli@v3
with:
version: 2.39.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [1.8, 11]
java: [ 17 ]
fail-fast: false

steps:
Expand Down
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
log4jVersion = '1.2.17'
springBootVersion = '2.7.0'
eclipsePersistenceVersion = '2.1.1'
springBootVersion = '3.1.3'
jakartaPersistenceVersion = '3.1.0'
kryoVersion = '4.0.2'
springCloudClusterVersion = '1.0.2.RELEASE'
springShellVersion = '1.1.0.RELEASE'
Expand Down Expand Up @@ -67,13 +67,13 @@ configure(javaProjectsAndRoot) {
}

compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
targetCompatibility = 17
}

compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
targetCompatibility = 17
}

group = 'org.springframework.statemachine'
Expand Down Expand Up @@ -218,7 +218,7 @@ project('spring-statemachine-core') {
testFixturesImplementation 'org.assertj:assertj-core'
testImplementation 'org.springframework.security:spring-security-config'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'javax.servlet:javax.servlet-api'
testImplementation 'jakarta.servlet:jakarta.servlet-api'
testImplementation 'org.awaitility:awaitility'
testRuntimeOnly 'org.apache.logging.log4j:log4j-core'
}
Expand All @@ -237,7 +237,7 @@ project('spring-statemachine-autoconfigure') {
optional project(':spring-statemachine-data-common:spring-statemachine-data-mongodb')
optional 'org.springframework.boot:spring-boot-autoconfigure-processor'
optional 'io.micrometer:micrometer-core'
optional 'org.eclipse.persistence:javax.persistence'
optional 'jakarta.persistence:jakarta.persistence-api'
optional 'org.springframework.boot:spring-boot-starter-data-jpa'
optional 'org.springframework.boot:spring-boot-starter-data-redis'
optional 'org.springframework.boot:spring-boot-starter-data-mongodb'
Expand Down Expand Up @@ -486,8 +486,8 @@ project('spring-statemachine-starter') {
configure(sampleProjects()) {
apply plugin: 'org.springframework.boot'
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
targetCompatibility = 17
}
dependencies {
api project(':spring-statemachine-core')
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu May 05 13:05:04 UTC 2022
version=3.3.0-SNAPSHOT
version=4.0.0-SNAPSHOT
4 changes: 2 additions & 2 deletions gradle/java-test-fixtures.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'java-test-fixtures'

compileTestFixturesJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
targetCompatibility = 17
}

eclipse.classpath {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2018 the original author or authors.
* Copyright 2016-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,10 @@
*/
package org.springframework.statemachine.boot.autoconfigure;

import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
Expand All @@ -30,54 +32,52 @@
import org.springframework.statemachine.boot.actuate.StateMachineTraceRepository;
import org.springframework.statemachine.boot.support.BootStateMachineMonitor;

import io.micrometer.core.instrument.MeterRegistry;

/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Statemachine.
*
* @author Janne Valkealahti
*
*/
@Configuration
@EnableConfigurationProperties({ StateMachineProperties.class })
@AutoConfiguration
@EnableConfigurationProperties({StateMachineProperties.class})
@ConditionalOnClass(MeterRegistry.class)
@ConditionalOnProperty(prefix = "spring.statemachine.monitor", name = "enabled", havingValue = "true", matchIfMissing = true)
public class StateMachineAutoConfiguration {

@ManagementContextConfiguration
public static class StateMachineTraceEndpointConfiguration {
@ManagementContextConfiguration
public static class StateMachineTraceEndpointConfiguration {

@Bean
public StateMachineTraceEndpoint stateMachineTraceEndpoint(StateMachineTraceRepository stateMachineTraceRepository) {
return new StateMachineTraceEndpoint(stateMachineTraceRepository);
}
}
@Bean
public StateMachineTraceEndpoint stateMachineTraceEndpoint(StateMachineTraceRepository stateMachineTraceRepository) {
return new StateMachineTraceEndpoint(stateMachineTraceRepository);
}
}

@Configuration
public static class StateMachineTraceRepositoryConfiguration {
@Configuration
public static class StateMachineTraceRepositoryConfiguration {

@ConditionalOnMissingBean(StateMachineTraceRepository.class)
@Bean
public InMemoryStateMachineTraceRepository stateMachineTraceRepository() {
return new InMemoryStateMachineTraceRepository();
}
}
@ConditionalOnMissingBean(StateMachineTraceRepository.class)
@Bean
public InMemoryStateMachineTraceRepository stateMachineTraceRepository() {
return new InMemoryStateMachineTraceRepository();
}
}

@Configuration
public static class StateMachineMonitoringConfiguration {
@Configuration
public static class StateMachineMonitoringConfiguration {

private final MeterRegistry meterRegistry;
private final StateMachineTraceRepository stateMachineTraceRepository;
private final MeterRegistry meterRegistry;
private final StateMachineTraceRepository stateMachineTraceRepository;

public StateMachineMonitoringConfiguration(ObjectProvider<MeterRegistry> meterRegistryProvider,
ObjectProvider<StateMachineTraceRepository> traceRepositoryProvider) {
this.meterRegistry = meterRegistryProvider.getIfAvailable();
this.stateMachineTraceRepository = traceRepositoryProvider.getIfAvailable();
}
public StateMachineMonitoringConfiguration(
ObjectProvider<MeterRegistry> meterRegistryProvider,
ObjectProvider<StateMachineTraceRepository> traceRepositoryProvider) {
this.meterRegistry = meterRegistryProvider.getIfAvailable();
this.stateMachineTraceRepository = traceRepositoryProvider.getIfAvailable();
}

@Bean
public BootStateMachineMonitor<?, ?> bootStateMachineMonitor() {
return new BootStateMachineMonitor<>(meterRegistry, stateMachineTraceRepository);
}
}
@Bean
public BootStateMachineMonitor<?, ?> bootStateMachineMonitor() {
return new BootStateMachineMonitor<>(meterRegistry, stateMachineTraceRepository);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,27 +15,24 @@
*/
package org.springframework.statemachine.boot.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.statemachine.data.jpa.JpaRepositoryState;
import org.springframework.statemachine.data.jpa.JpaStateRepository;

/**
* {@link EnableAutoConfiguration Auto-configuration} for JPA repositories
* and Entity classes.
* {@link EnableAutoConfiguration Auto-configuration} for JPA repositories and Entity classes.
*/
@Configuration
@AutoConfiguration(after = JpaRepositoriesAutoConfiguration.class)
@ConditionalOnClass(JpaStateRepository.class)
@ConditionalOnProperty(prefix = "spring.statemachine.data.jpa.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@AutoConfigureAfter(JpaRepositoriesAutoConfiguration.class)
@EntityScan(basePackageClasses = { JpaRepositoryState.class })
@EnableJpaRepositories(basePackageClasses = { JpaStateRepository.class })
@EntityScan(basePackageClasses = {JpaRepositoryState.class})
@EnableJpaRepositories(basePackageClasses = {JpaStateRepository.class})
public class StateMachineJpaRepositoriesAutoConfiguration {

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,27 +15,24 @@
*/
package org.springframework.statemachine.boot.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import org.springframework.statemachine.data.mongodb.MongoDbRepositoryState;
import org.springframework.statemachine.data.mongodb.MongoDbStateRepository;

/**
* {@link EnableAutoConfiguration Auto-configuration} for MongoDb repositories
* and Entity classes.
* {@link EnableAutoConfiguration Auto-configuration} for MongoDb repositories and Entity classes.
*/
@Configuration
@AutoConfiguration(after = MongoRepositoriesAutoConfiguration.class)
@ConditionalOnClass(MongoDbStateRepository.class)
@ConditionalOnProperty(prefix = "spring.statemachine.data.mongo.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@AutoConfigureAfter(MongoRepositoriesAutoConfiguration.class)
@EntityScan(basePackageClasses = { MongoDbRepositoryState.class })
@EnableMongoRepositories(basePackageClasses = { MongoDbStateRepository.class })
@EntityScan(basePackageClasses = {MongoDbRepositoryState.class})
@EnableMongoRepositories(basePackageClasses = {MongoDbStateRepository.class})
public class StateMachineMongoDbRepositoriesAutoConfiguration {

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,27 +15,24 @@
*/
package org.springframework.statemachine.boot.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
import org.springframework.statemachine.data.redis.RedisRepositoryState;
import org.springframework.statemachine.data.redis.RedisStateRepository;

/**
* {@link EnableAutoConfiguration Auto-configuration} for Redis repositories
* and Entity classes.
* {@link EnableAutoConfiguration Auto-configuration} for Redis repositories and Entity classes.
*/
@Configuration
@AutoConfiguration(after = RedisRepositoriesAutoConfiguration.class)
@ConditionalOnClass(RedisStateRepository.class)
@ConditionalOnProperty(prefix = "spring.statemachine.data.redis.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@AutoConfigureAfter(RedisRepositoriesAutoConfiguration.class)
@EntityScan(basePackageClasses = { RedisRepositoryState.class })
@EnableRedisRepositories(basePackageClasses = { RedisStateRepository.class })
@EntityScan(basePackageClasses = {RedisRepositoryState.class})
@EnableRedisRepositories(basePackageClasses = {RedisStateRepository.class})
public class StateMachineRedisRepositoriesAutoConfiguration {

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.statemachine.boot.autoconfigure.StateMachineAutoConfiguration,\
org.springframework.statemachine.boot.autoconfigure.StateMachineJpaRepositoriesAutoConfiguration,\
org.springframework.statemachine.boot.autoconfigure.StateMachineRedisRepositoriesAutoConfiguration,\
org.springframework.statemachine.boot.autoconfigure.StateMachineMongoDbRepositoriesAutoConfiguration

org.springframework.statemachine.boot.autoconfigure.StateMachineAutoConfiguration
org.springframework.statemachine.boot.autoconfigure.StateMachineJpaRepositoriesAutoConfiguration
org.springframework.statemachine.boot.autoconfigure.StateMachineRedisRepositoriesAutoConfiguration
org.springframework.statemachine.boot.autoconfigure.StateMachineMongoDbRepositoriesAutoConfiguration
Loading
Loading