使用2.3.9.RELEASE添加了以下依赖项:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>尝试创建动态ES索引
@Document(indexName = "test_#{@commonConfig.getEnv()}_v1")@Component("commonConfig")
public class CommonConfig {
@Value("${spring.profiles.active}")
private String env;
public String getEnv() {
return env.toLowerCase(Locale.ROOT);
}
}发布于 2022-04-25 13:08:37
引导2.3.x不再支持https://spring.io/projects/spring-boot#support,上一次发布是去年夏天的2.3.12。
在任何情况下,Boot2.3.x都使用spring Commons2.3.x (2.3.9拉进2.3.7)。
ExpressionDependencies直到2.4才被添加到SpringData-Commons2.4中,所以您有一些不匹配的依赖项。
https://stackoverflow.com/questions/71949161
复制相似问题