Skip to content

Commit f6e5c1a

Browse files
Spring 3.x / Jedis 4.x / Java 17 Upgrade (#160)
* build: upgrade to Java 17 * feature: Spring 3.x upgrade * dependencies: update to match Spring v3.0.2 * release: v7.0.0 - Spring 3.x - Java 17 * Use JDK 17 on Github integration workflow * Use JDK 17 on Github codeql workflow * upgrade CodeQL to v2 * refactor: use framework GSon instance for typed MGET * refactor: clean up tests * refactor: make UnifiedJedis instance private to RedisModulesClient Co-authored-by: maor.ohana <[email protected]>
1 parent 0e07bc3 commit f6e5c1a

File tree

260 files changed

+4202
-5957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+4202
-5957
lines changed

.classpath

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
<attribute name="maven.pomderived" value="true"/>
1414
</attributes>
1515
</classpathentry>
16-
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
17-
<attributes>
18-
<attribute name="maven.pomderived" value="true"/>
19-
</attributes>
20-
</classpathentry>
2116
<classpathentry kind="src" path="target/generated-sources/annotations">
2217
<attributes>
2318
<attribute name="ignore_optional_problems" value="true"/>
@@ -35,6 +30,11 @@
3530
<attribute name="m2e-apt" value="true"/>
3631
</attributes>
3732
</classpathentry>
38-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
33+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
34+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
35+
<attributes>
36+
<attribute name="maven.pomderived" value="true"/>
37+
</attributes>
38+
</classpathentry>
3939
<classpathentry kind="output" path="target/classes"/>
40-
</classpath>
40+
</classpath>

.github/workflows/codeql-analysis.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
42+
uses: github/codeql-action/init@v2
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -49,8 +49,12 @@ jobs:
4949

5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Set up JDK 17
53+
uses: actions/setup-java@v1
54+
with:
55+
java-version: 17
5256
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v2
5458

5559
# ℹ️ Command-line programs to run using the OS shell.
5660
# 📚 https://git.io/JvXDl
@@ -64,4 +68,4 @@ jobs:
6468
# make release
6569

6670
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v2

.github/workflows/integration.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
~/.mv2/repository
2222
key: om-${{hashFiles('**/pom.xml')}}
2323

24-
- name: Set up JDK 11
24+
- name: Set up JDK 17
2525
uses: actions/setup-java@v1
2626
with:
27-
java-version: 11
27+
java-version: 17
2828
- run: mvn dependency:go-offline
2929
- name: Build
3030
run: mvn clean process-test-classes verify

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,18 @@ package com.redis.om.documents.domain;
145145

146146
import java.util.HashSet;
147147
import java.util.Set;
148+
148149
import org.springframework.data.annotation.Id;
149150
import org.springframework.data.geo.Point;
150151
import com.redis.om.spring.annotations.Document;
151152
import com.redis.om.spring.annotations.Searchable;
152153
import lombok.*;
153154

154-
@Data
155-
@NoArgsConstructor
156-
@RequiredArgsConstructor(staticName = "of")
157-
@AllArgsConstructor(access = AccessLevel.PROTECTED)
158-
@Document
159-
public class Company {
155+
@Data @NoArgsConstructor @RequiredArgsConstructor(staticName = "of") @AllArgsConstructor(access = AccessLevel.PROTECTED) @Document public class Company {
160156
@Id private String id;
161157
@Searchable private String name;
162158
@Indexed private Point location;
163-
@Indexed private Set<String> tags = new HashSet<String>();
159+
@Indexed private Set<String> tags = new HashSet<>();
164160
@Indexed private Integer numberOfEmployees;
165161
@Indexed private Integer yearFounded;
166162
private String url;
@@ -363,7 +359,7 @@ hit us up on the [Redis Discord Server](http://discord.gg/redis).
363359

364360
## ✨ So How Do You Get RediSearch and RedisJSON?
365361

366-
Some advanced features of Redis OM rely on core features from two source available Redis modules: [RediSearch][redisearch-url] and [RedisJSON][redis-json-url].
362+
Redis OM relies on two source available Redis modules: [RediSearch][redisearch-url] and [RedisJSON][redis-json-url].
367363

368364
You can run these modules in your self-hosted Redis deployment, or you can use [Redis Enterprise][redis-enterprise-url], which includes both modules.
369365

demos/roms-documents/pom.xml

+43-24
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>2.7.7</version>
9+
<version>3.0.1</version>
1010
<relativePath /> <!-- lookup parent from repository -->
1111
</parent>
1212

@@ -17,20 +17,20 @@
1717
<description>Redis OM Spring Document Demo</description>
1818

1919
<properties>
20-
<java.version>11</java.version>
21-
<maven.compiler.release>11</maven.compiler.release>
22-
<maven.compiler.source>11</maven.compiler.source>
23-
<maven.compiler.target>11</maven.compiler.target>
24-
<maven.test.source>11</maven.test.source>
25-
<maven.test.target>11</maven.test.target>
20+
<java.version>17</java.version>
21+
<maven.compiler.release>17</maven.compiler.release>
22+
<maven.compiler.source>17</maven.compiler.source>
23+
<maven.compiler.target>17</maven.compiler.target>
24+
<maven.test.source>17</maven.test.source>
25+
<maven.test.target>17</maven.test.target>
2626
<maven.deploy.skip>true</maven.deploy.skip>
2727
</properties>
2828

2929
<dependencies>
3030
<dependency>
3131
<groupId>com.redis.om</groupId>
3232
<artifactId>redis-om-spring</artifactId>
33-
<version>0.6.4</version>
33+
<version>0.7.0</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>org.springframework.boot</groupId>
@@ -52,31 +52,50 @@
5252
<artifactId>spring-boot-starter-test</artifactId>
5353
<scope>test</scope>
5454
</dependency>
55-
<!-- test dependencies -->
56-
<dependency>
57-
<groupId>org.junit.jupiter</groupId>
58-
<artifactId>junit-jupiter</artifactId>
59-
<scope>test</scope>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.assertj</groupId>
63-
<artifactId>assertj-core</artifactId>
64-
<scope>test</scope>
65-
</dependency>
66-
<dependency>
67-
<groupId>org.springframework</groupId>
68-
<artifactId>spring-test</artifactId>
69-
<scope>test</scope>
70-
</dependency>
7155
</dependencies>
7256

7357
<repositories>
7458
<repository>
7559
<id>snapshots-repo</id>
7660
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
7761
</repository>
62+
<repository>
63+
<id>spring-milestones</id>
64+
<name>Spring Milestones</name>
65+
<url>https://repo.spring.io/milestone</url>
66+
<snapshots>
67+
<enabled>false</enabled>
68+
</snapshots>
69+
</repository>
70+
<repository>
71+
<id>spring-snapshots</id>
72+
<name>Spring Snapshots</name>
73+
<url>https://repo.spring.io/snapshot</url>
74+
<releases>
75+
<enabled>false</enabled>
76+
</releases>
77+
</repository>
7878
</repositories>
7979

80+
<pluginRepositories>
81+
<pluginRepository>
82+
<id>spring-milestones</id>
83+
<name>Spring Milestones</name>
84+
<url>https://repo.spring.io/milestone</url>
85+
<snapshots>
86+
<enabled>false</enabled>
87+
</snapshots>
88+
</pluginRepository>
89+
<pluginRepository>
90+
<id>spring-snapshots</id>
91+
<name>Spring Snapshots</name>
92+
<url>https://repo.spring.io/snapshot</url>
93+
<releases>
94+
<enabled>false</enabled>
95+
</releases>
96+
</pluginRepository>
97+
</pluginRepositories>
98+
8099
<build>
81100
<plugins>
82101
<plugin>

demos/roms-documents/src/main/java/com/redis/om/documents/RomsDocumentsApplication.java

+16
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.redis.om.documents;
22

3+
import java.util.Arrays;
34
import java.util.Set;
45

56
import org.springframework.beans.factory.annotation.Autowired;
67
import org.springframework.boot.CommandLineRunner;
78
import org.springframework.boot.SpringApplication;
89
import org.springframework.boot.autoconfigure.SpringBootApplication;
10+
import org.springframework.context.ApplicationContext;
911
import org.springframework.context.annotation.Bean;
1012
import org.springframework.data.geo.Point;
1113

@@ -25,6 +27,20 @@ public class RomsDocumentsApplication {
2527

2628
@Autowired
2729
PersonRepository personRepo;
30+
31+
@Bean
32+
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
33+
return args -> {
34+
35+
System.out.println("Let's inspect the beans provided by Spring Boot:");
36+
37+
String[] beanNames = ctx.getBeanDefinitionNames();
38+
Arrays.sort(beanNames);
39+
for (String beanName : beanNames) {
40+
System.out.println(beanName);
41+
}
42+
};
43+
}
2844

2945
@Bean
3046
CommandLineRunner loadTestData() {

demos/roms-documents/src/main/java/com/redis/om/documents/domain/Company.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class Company {
3434
private String name;
3535

3636
@Indexed
37-
private Set<String> tags = new HashSet<String>();
37+
private Set<String> tags = new HashSet<>();
3838

3939
@NonNull
4040
private String url;

demos/roms-hashes/pom.xml

+24-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>2.7.7</version>
9+
<version>3.0.1</version>
1010
<relativePath /> <!-- lookup parent from repository -->
1111
</parent>
1212

@@ -17,20 +17,20 @@
1717
<description>Redis OM Spring Enhanced RedisHash Demo</description>
1818

1919
<properties>
20-
<java.version>11</java.version>
21-
<maven.compiler.release>11</maven.compiler.release>
22-
<maven.compiler.source>11</maven.compiler.source>
23-
<maven.compiler.target>11</maven.compiler.target>
24-
<maven.test.source>11</maven.test.source>
25-
<maven.test.target>11</maven.test.target>
20+
<java.version>17</java.version>
21+
<maven.compiler.release>17</maven.compiler.release>
22+
<maven.compiler.source>17</maven.compiler.source>
23+
<maven.compiler.target>17</maven.compiler.target>
24+
<maven.test.source>17</maven.test.source>
25+
<maven.test.target>17</maven.test.target>
2626
<maven.deploy.skip>true</maven.deploy.skip>
2727
</properties>
2828

2929
<dependencies>
3030
<dependency>
3131
<groupId>com.redis.om</groupId>
3232
<artifactId>redis-om-spring</artifactId>
33-
<version>0.6.4</version>
33+
<version>0.7.0</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>org.springframework.boot</groupId>
@@ -59,6 +59,22 @@
5959
<id>snapshots-repo</id>
6060
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
6161
</repository>
62+
<repository>
63+
<id>spring-milestones</id>
64+
<name>Spring Milestones</name>
65+
<url>https://repo.spring.io/milestone</url>
66+
<snapshots>
67+
<enabled>false</enabled>
68+
</snapshots>
69+
</repository>
70+
<repository>
71+
<id>spring-snapshots</id>
72+
<name>Spring Snapshots</name>
73+
<url>https://repo.spring.io/snapshot</url>
74+
<releases>
75+
<enabled>false</enabled>
76+
</releases>
77+
</repository>
6278
</repositories>
6379

6480
<build>

demos/roms-permits/pom.xml

+24-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>2.7.7</version>
9+
<version>3.0.1</version>
1010
<relativePath />
1111
<!-- lookup parent from repository -->
1212
</parent>
@@ -17,12 +17,12 @@
1717
<description>Demo project for Spring Boot</description>
1818

1919
<properties>
20-
<java.version>11</java.version>
21-
<maven.compiler.release>11</maven.compiler.release>
22-
<maven.compiler.source>11</maven.compiler.source>
23-
<maven.compiler.target>11</maven.compiler.target>
24-
<maven.test.source>11</maven.test.source>
25-
<maven.test.target>11</maven.test.target>
20+
<java.version>17</java.version>
21+
<maven.compiler.release>17</maven.compiler.release>
22+
<maven.compiler.source>17</maven.compiler.source>
23+
<maven.compiler.target>17</maven.compiler.target>
24+
<maven.test.source>17</maven.test.source>
25+
<maven.test.target>17</maven.test.target>
2626
<maven.deploy.skip>true</maven.deploy.skip>
2727
</properties>
2828

@@ -34,7 +34,7 @@
3434
<dependency>
3535
<groupId>com.redis.om</groupId>
3636
<artifactId>redis-om-spring</artifactId>
37-
<version>0.6.4</version>
37+
<version>0.7.0</version>
3838
</dependency>
3939

4040
<dependency>
@@ -60,6 +60,22 @@
6060
<id>snapshots-repo</id>
6161
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
6262
</repository>
63+
<repository>
64+
<id>spring-milestones</id>
65+
<name>Spring Milestones</name>
66+
<url>https://repo.spring.io/milestone</url>
67+
<snapshots>
68+
<enabled>false</enabled>
69+
</snapshots>
70+
</repository>
71+
<repository>
72+
<id>spring-snapshots</id>
73+
<name>Spring Snapshots</name>
74+
<url>https://repo.spring.io/snapshot</url>
75+
<releases>
76+
<enabled>false</enabled>
77+
</releases>
78+
</repository>
6379
</repositories>
6480

6581
<build>

docs/faq.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Frequently Asked Questions

docs/index.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# Redis OM Spring
1+
# Redis OM Spring
2+
3+
## Table of Contents

0 commit comments

Comments
 (0)