fix: cross-Boot-version autoconfiguration and CI-friendly version resolution
- OrdoJdbcAutoConfiguration: use string-based @AutoConfigureAfter(name = ...) to reference both Spring Boot 3.x and 4.x DataSource/Flyway autoconfiguration classes, since Boot 4 relocated these to dedicated modules. - flatten-maven-plugin: switch flattenMode from resolveCiFriendliesOnly to defaults so inter-module dependency versions are fully resolved (not just the project's own <version>) when installed, fixing dependency resolution for external consumers. - Align sibling-module dependency versions to use \ consistently. - Ignore generated .flattened-pom.xml files.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jetlumen</groupId>
|
||||
<artifactId>ordo</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ordo-spring-boot-autoconfigure</artifactId>
|
||||
@@ -34,17 +34,17 @@
|
||||
<dependency>
|
||||
<groupId>com.jetlumen</groupId>
|
||||
<artifactId>ordo-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jetlumen</groupId>
|
||||
<artifactId>ordo-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jetlumen</groupId>
|
||||
<artifactId>ordo-storage-jdbc</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
+8
-3
@@ -18,8 +18,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -37,7 +35,14 @@ import java.time.Clock;
|
||||
@ConditionalOnProperty(prefix = "ordo", name = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnClass(DataSource.class)
|
||||
@ConditionalOnBean(DataSource.class)
|
||||
@AutoConfigureAfter({DataSourceAutoConfiguration.class, FlywayAutoConfiguration.class})
|
||||
@AutoConfigureAfter(name = {
|
||||
// Spring Boot 3.x locations
|
||||
"org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration",
|
||||
"org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration",
|
||||
// Spring Boot 4.x locations (JDBC/Flyway autoconfiguration moved to dedicated modules)
|
||||
"org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration",
|
||||
"org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration"
|
||||
})
|
||||
@EnableConfigurationProperties(OrdoProperties.class)
|
||||
public class OrdoJdbcAutoConfiguration {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user