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/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 33a1346..01f5557 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,14 +6,14 @@
org.springframework.boot
spring-boot-starter-parent
- 2.6.15
+ 2.7.18
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
@@ -164,9 +164,8 @@
maven-surefire-plugin
${maven-surefire-plugin.version}
-
- true
- true
+ false
+ false
@@ -412,6 +411,11 @@
2.22.1
1.6.8
2.7.0
+ 5.3.39
+ 2.7
+ 2.9.0
+ 3.27.7
+ 2.10.0
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..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
@@ -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("美国|0|0|0|Level3");
System.out.println(template.memorySearch("127.0.0.1"));
System.out.println(template.memorySearch("114.124.146.103"));