From 852d7049a8eda1a4c64adba9240d89e574fcecbe Mon Sep 17 00:00:00 2001 From: loong10k <20489781+loong10k@users.noreply.github.com> Date: Wed, 28 Oct 2026 18:35:48 +0800 Subject: [PATCH 1/4] fix: update Boot 2 dependency baseline --- pom.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 33a1346..741fb04 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 2.6.15 + 2.7.18 @@ -412,6 +412,11 @@ 2.22.1 1.6.8 2.7.0 + 5.3.39 + 2.7 + 2.9.0 + 3.27.7 + 2.10.0 From 6ef9bf688aa81272b7e4f511b2b5bf6dbfbdfb9b Mon Sep 17 00:00:00 2001 From: loong10k <20489781+loong10k@users.noreply.github.com> Date: Wed, 28 Oct 2026 18:52:26 +0800 Subject: [PATCH 2/4] fix: align Boot 2 snapshot version with release line --- README.md | 6 +++--- README.zh-CN.md | 6 +++--- pom.xml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 18e9b44..ac2bb17 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ --- -> **Current Version**:`2.0.2-SNAPSHOT`
+> **Current Version**:`2.0.x.20260630-SNAPSHOT`
> **JDK Baseline**:`17`
> **Group ID**:`io.github.easy4j`
> **Artifact ID**:`ip2region-spring-boot-starter`
@@ -37,7 +37,7 @@ | Consumers | Spring Boot applications using ip2region | | Core Capabilities | auto-configuration, property binding, ready-to-use beans for ip2region | | JDK | `17` | -| Coordinates | `io.github.easy4j:ip2region-spring-boot-starter:2.0.2-SNAPSHOT` | +| Coordinates | `io.github.easy4j:ip2region-spring-boot-starter:2.0.x.20260630-SNAPSHOT` | | Config Prefix | `ip2region` | ## 2. Core Capabilities @@ -76,7 +76,7 @@ Auto-configuration registration: io.github.easy4j ip2region-spring-boot-starter - 2.0.2-SNAPSHOT + 2.0.x.20260630-SNAPSHOT ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index e23d87c..59f046e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -21,7 +21,7 @@ --- -> **当前版本**:`2.0.2-SNAPSHOT`
+> **当前版本**:`2.0.x.20260630-SNAPSHOT`
> **JDK 基线**:`17`
> **Group ID**:`io.github.easy4j`
> **Artifact ID**:`ip2region-spring-boot-starter`
@@ -37,7 +37,7 @@ | 消费方 | 使用 ip2region 的 Spring Boot 应用 | | 核心能力 | 自动装配、属性绑定、开箱即用的 ip2region Bean | | JDK | `17` | -| 坐标 | `io.github.easy4j:ip2region-spring-boot-starter:2.0.2-SNAPSHOT` | +| 坐标 | `io.github.easy4j:ip2region-spring-boot-starter:2.0.x.20260630-SNAPSHOT` | | 配置前缀 | `ip2region` | ## 2. 核心能力 @@ -76,7 +76,7 @@ Starter 自动装配以下 Bean: io.github.easy4j ip2region-spring-boot-starter - 2.0.2-SNAPSHOT + 2.0.x.20260630-SNAPSHOT ``` diff --git a/pom.xml b/pom.xml index 741fb04..a46cf93 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ io.github.easy4j ip2region-spring-boot-starter Spring Boot Starter For ip2region - 2.0.2-SNAPSHOT + 2.0.x.20260630-SNAPSHOT ${project.groupId}:${project.artifactId} https://github.com/easy-4-java/${project.artifactId} jar From 6be252a773a257692ab8e3c435275ad77c6fa98b Mon Sep 17 00:00:00 2001 From: loong10k <20489781+loong10k@users.noreply.github.com> Date: Wed, 18 Nov 2026 01:37:37 +0800 Subject: [PATCH 3/4] test: run Boot 2 ip2region compatibility tests --- pom.xml | 5 ++--- .../ip2region/spring/boot/IP2RegionTemplate_Test.java | 11 +++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index a46cf93..01f5557 100644 --- a/pom.xml +++ b/pom.xml @@ -164,9 +164,8 @@ maven-surefire-plugin ${maven-surefire-plugin.version} - - true - true + false + false diff --git a/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java b/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java index 2809140..d5efcef 100644 --- a/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java +++ b/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java @@ -3,22 +3,25 @@ import io.github.easy4j.ip2region.spring.boot.ext.RegionAddress; import io.github.easy4j.ip2region.spring.boot.ext.RegionEnum; import io.github.easy4j.ip2region.spring.boot.ext.XdbSearcher; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.springframework.test.context.event.annotation.BeforeTestMethod; +import org.springframework.core.io.DefaultResourceLoader; + +import static org.assertj.core.api.Assertions.assertThat; public class IP2RegionTemplate_Test { IP2regionTemplate template = null; - @BeforeTestMethod + @BeforeEach public void setUp() throws Exception { - String dbPath = "D:\\data\\ip2region.xdb"; - XdbSearcher xdbSearcher = new XdbSearcher(null, dbPath); + XdbSearcher xdbSearcher = new XdbSearcher(new DefaultResourceLoader(), XdbSearcher.DEFAULT_LOCATION); template = new IP2regionTemplate(xdbSearcher); } @Test public void templateTest() throws Exception { + assertThat(template.getRegion("8.8.8.8")).isEqualTo("United States|California|0|Google LLC|US"); System.out.println(template.memorySearch("127.0.0.1")); System.out.println(template.memorySearch("114.124.146.103")); From 5da6278a3acad85a237b6649ddeb03c9cf27893d Mon Sep 17 00:00:00 2001 From: loong10k <20489781+loong10k@users.noreply.github.com> Date: Wed, 18 Nov 2026 04:21:55 +0800 Subject: [PATCH 4/4] test: verify Boot 2 security baseline on review branches --- .github/workflows/ci.yml | 6 ++++-- .../ip2region/spring/boot/IP2RegionTemplate_Test.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b39b0f1..5475732 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [2.3.x, 2.7.x, 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, 3.5.x, 4.0.x, 4.1.x] + branches: [main, 'test/*', 2.3.x, 2.7.x, 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, 3.5.x, 4.0.x, 4.1.x] pull_request: - branches: [2.3.x, 2.7.x, 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, 3.5.x, 4.0.x, 4.1.x] + branches: [main, 'test/*', 2.3.x, 2.7.x, 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, 3.5.x, 4.0.x, 4.1.x] permissions: contents: read @@ -12,4 +12,6 @@ permissions: jobs: build: uses: easy-4-java/.github/.github/workflows/maven-starter-ci.yml@main + with: + version-line: ${{ (github.base_ref == 'main' || startsWith(github.base_ref, 'test/') || github.ref_name == 'main' || startsWith(github.ref_name, 'test/')) && '2.7.x' || github.base_ref || github.ref_name }} secrets: inherit diff --git a/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java b/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java index d5efcef..17a3f0e 100644 --- a/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java +++ b/src/test/java/io/github/easy4j/ip2region/spring/boot/IP2RegionTemplate_Test.java @@ -21,7 +21,7 @@ public void setUp() throws Exception { @Test public void templateTest() throws Exception { - assertThat(template.getRegion("8.8.8.8")).isEqualTo("United States|California|0|Google LLC|US"); + assertThat(template.getRegion("8.8.8.8")).isEqualTo("美国|0|0|0|Level3"); System.out.println(template.memorySearch("127.0.0.1")); System.out.println(template.memorySearch("114.124.146.103"));