mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
build: 升级 Spring Boot 版本
This commit is contained in:
parent
31bd2c0bf8
commit
a3a2384c95
35
pom.xml
35
pom.xml
@ -6,7 +6,8 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.0.0-M3</version>
|
<version>3.0.0-M4</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>io.github.xxyopen</groupId>
|
<groupId>io.github.xxyopen</groupId>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
@ -16,6 +17,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<mybatis-plus.version>3.5.1</mybatis-plus.version>
|
<mybatis-plus.version>3.5.1</mybatis-plus.version>
|
||||||
|
<spring.version>6.0.0-SNAPSHOT</spring.version>
|
||||||
<jjwt.version>0.11.5</jjwt.version>
|
<jjwt.version>0.11.5</jjwt.version>
|
||||||
<elasticsearch.version>8.2.0</elasticsearch.version>
|
<elasticsearch.version>8.2.0</elasticsearch.version>
|
||||||
<xxl-job.version>2.3.1</xxl-job.version>
|
<xxl-job.version>2.3.1</xxl-job.version>
|
||||||
@ -233,15 +235,20 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spring-snapshots</id>
|
<id>spring-milestones</id>
|
||||||
<url>https://repo.spring.io/snapshot</url>
|
<name>Spring Milestones</name>
|
||||||
|
<url>https://repo.spring.io/milestone</url>
|
||||||
<snapshots>
|
<snapshots>
|
||||||
<enabled>true</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spring-milestones</id>
|
<id>spring-snapshots</id>
|
||||||
<url>https://repo.spring.io/milestone</url>
|
<name>Spring Snapshots</name>
|
||||||
|
<url>https://repo.spring.io/snapshot</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>sonatype-nexus-snapshots</id>
|
<id>sonatype-nexus-snapshots</id>
|
||||||
@ -278,12 +285,20 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<id>spring-snapshots</id>
|
<id>spring-milestones</id>
|
||||||
<url>https://repo.spring.io/snapshot</url>
|
<name>Spring Milestones</name>
|
||||||
|
<url>https://repo.spring.io/milestone</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<id>spring-milestones</id>
|
<id>spring-snapshots</id>
|
||||||
<url>https://repo.spring.io/milestone</url>
|
<name>Spring Snapshots</name>
|
||||||
|
<url>https://repo.spring.io/snapshot</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
|
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.core.config;
|
package io.github.xxyopen.novel.core.config;
|
||||||
|
|
||||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
|
||||||
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
|
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
|
||||||
import co.elastic.clients.transport.ElasticsearchTransport;
|
|
||||||
import co.elastic.clients.transport.rest_client.RestClientTransport;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.elasticsearch.client.RestClient;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@ -17,19 +11,14 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
* @date 2022/5/23
|
* @date 2022/5/23
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnProperty(prefix = "spring.elasticsearch", name = "enabled", havingValue = "true")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class EsConfig {
|
public class EsConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解决 ElasticsearchClientConfigurations 修改默认 ObjectMapper 配置的问题
|
||||||
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public ElasticsearchClient elasticsearchClient(RestClient restClient) {
|
JacksonJsonpMapper jacksonJsonpMapper() {
|
||||||
|
return new JacksonJsonpMapper();
|
||||||
// Create the transport with a Jackson mapper
|
|
||||||
ElasticsearchTransport transport = new RestClientTransport(
|
|
||||||
restClient, new JacksonJsonpMapper());
|
|
||||||
|
|
||||||
// And create the API client
|
|
||||||
return new ElasticsearchClient(transport);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user