Skip to content

Commit 8240c42

Browse files
committed
docs: 新增中英文双语 README(统一格式)
1 parent 6be99b3 commit 8240c42

67 files changed

Lines changed: 8430 additions & 1 deletion

File tree

Some content is hidden

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

README.md

Lines changed: 167 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,168 @@
1+
<a id="readme-top"></a>
2+
3+
<div align="center">
4+
15
# spring-boot-starter-samples
2-
spring-boot-starter-samples
6+
7+
**Spring Boot Starter for spring-boot-samples**
8+
9+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.easy4j/spring-boot-starter-samples)](https://github.com/easy-4-java/spring-boot-starter-samples)
10+
[![Java](https://img.shields.io/badge/Java-17-orange)](#3-requirements-and-compatibility)
11+
[![License](https://img.shields.io/badge/license-Apache-2.0-green)](https://www.apache.org/licenses/LICENSE-2.0)
12+
13+
[简体中文](./README.zh-CN.md) | [English](./README.md)
14+
15+
[Positioning](#1-positioning) · [Capabilities](#2-core-capabilities) ·
16+
[Dependency](#5-dependency) · [Quick Start](#6-quick-start) ·
17+
[Configuration](#7-configuration-reference) · [Versions](#9-version-lines-and-compatibility) ·
18+
[Build](#10-build-and-test) · [License](#12-license)
19+
20+
</div>
21+
22+
---
23+
24+
> **Current Version**`1.0.0-SNAPSHOT`<br>
25+
> **JDK Baseline**`17`<br>
26+
> **Group ID**`io.github.easy4j`<br>
27+
> **Artifact ID**`spring-boot-starter-samples`<br>
28+
> **License**:Apache License 2.0<br>
29+
30+
## 1. Positioning
31+
32+
**spring-boot-starter-samples** is a Spring Boot starter that integrates **spring-boot-samples** for applications using spring-boot-samples. It provides auto-configuration, property binding, and ready-to-use beans so that applications can consume spring-boot-samples capabilities with minimal setup.
33+
34+
| Dimension | Description |
35+
|---|---|
36+
| Type | Spring Boot Starter |
37+
| Consumers | Spring Boot applications using spring-boot-samples |
38+
| Core Capabilities | auto-configuration, property binding, ready-to-use beans for spring-boot-samples |
39+
| JDK | `17` |
40+
| Coordinates | `io.github.easy4j:spring-boot-starter-samples:1.0.0-SNAPSHOT` |
41+
| Config Prefix | `spring.boot.samples` |
42+
43+
## 2. Core Capabilities
44+
45+
| Capability | Status | Description |
46+
|---|:---:|---|
47+
| Auto-configuration | ✅ Stable | Registers spring-boot-samples beans automatically |
48+
| Property Binding | ✅ Stable | Binds `spring.boot.samples.*` to `Properties` |
49+
| Ready-to-use beans | ✅ Stable | Auto-registered via auto-configuration |
50+
51+
## 3. Requirements and Compatibility
52+
53+
| Dependency | Minimum | Evidence |
54+
|---|---:|---|
55+
| JDK | `17` | `pom.xml` |
56+
| Spring Boot | `1.0.2-SNAPSHOT` | `pom.xml` parent |
57+
| Maven | `3.6+` | Maven Enforcer |
58+
59+
## 4. Auto-configuration
60+
61+
The starter auto-configures the following beans:
62+
63+
| Bean | Condition | Missing Behavior |
64+
|---|---|---|
65+
| `Object` | classpath + property | not created |
66+
67+
Auto-configuration registration:
68+
69+
- `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports` (Spring Boot 2.7+ / 3.x / 4.x)
70+
- `META-INF/spring.factories` (Spring Boot 2.x legacy)
71+
72+
## 5. Dependency
73+
74+
```xml
75+
<dependency>
76+
<groupId>io.github.easy4j</groupId>
77+
<artifactId>spring-boot-starter-samples</artifactId>
78+
<version>1.0.0-SNAPSHOT</version>
79+
</dependency>
80+
```
81+
82+
No additional easy4j component dependencies.
83+
84+
## 6. Quick Start
85+
86+
### 6.1 Add dependency
87+
88+
Add the dependency above to your `pom.xml`.
89+
90+
### 6.2 Configure
91+
92+
```yaml
93+
spring.boot.samples:
94+
enabled: true
95+
```
96+
97+
### 6.3 Use the bean
98+
99+
```java
100+
@SpringBootApplication
101+
public class Application {
102+
public static void main(String[] args) {
103+
SpringApplication.run(Application.class, args);
104+
}
105+
}
106+
```
107+
108+
Then inject the auto-configured bean in your code:
109+
110+
```java
111+
@Autowired
112+
private Object bean;
113+
```
114+
115+
## 7. Configuration Reference
116+
117+
### 7.1 Config Prefix
118+
119+
`spring.boot.samples`
120+
121+
### 7.2 Configuration Items
122+
123+
| Property | Type | Default | Required | Description | Sensitive |
124+
|---|---|---|:---:|---|:---:|
125+
| `spring.boot.samples.enabled` | boolean | `true` | No | Enable the starter | No |
126+
<!-- additional properties below -->
127+
128+
## 8. Version Lines and Compatibility
129+
130+
| Branch | JDK | Spring Boot | Component Version | Status |
131+
|---|---:|---:|---|:---:|
132+
| `2.3.x` / `2.7.x` | `8+` | 2.3.x / 2.7.x | `1.0.x` | Maintenance |
133+
| `3.0.x` ~ `3.5.x` | `17` | 3.x | `2.0.x` | Maintenance |
134+
| `4.0.x` / `4.1.x` | `17+` | 4.x | `3.0.x` | Active |
135+
136+
## 9. Build and Test
137+
138+
```bash
139+
mvn clean verify
140+
mvn -pl spring-boot-starter-samples -am test
141+
```
142+
143+
## 10. Troubleshooting
144+
145+
| Symptom | Diagnosis | Resolution |
146+
|---|---|---|
147+
| Bean not created | Check auto-configuration report | Verify `spring.boot.samples.enabled=true` and classpath |
148+
| `ClassNotFoundException` | Missing dependency | Add the required module |
149+
| Version conflict | `mvn dependency:tree` | Use BOM for version alignment |
150+
151+
## 11. Contribution
152+
153+
1. Fork the repository.
154+
2. Create a feature branch.
155+
3. Run `mvn clean verify` before submitting.
156+
4. Submit a pull request.
157+
158+
## 12. License
159+
160+
This project is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
161+
162+
---
163+
164+
<div align="center">
165+
166+
[Back to top](#readme-top) · [Issues](https://github.com/easy-4-java/spring-boot-starter-samples/issues) · [Repository](https://github.com/easy-4-java/spring-boot-starter-samples)
167+
168+
</div>

README.zh-CN.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<a id="readme-top"></a>
2+
3+
<div align="center">
4+
5+
# spring-boot-starter-samples
6+
7+
**Spring Boot Starter,集成 spring-boot-samples**
8+
9+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.easy4j/spring-boot-starter-samples)](https://github.com/easy-4-java/spring-boot-starter-samples)
10+
[![Java](https://img.shields.io/badge/Java-17-orange)](#3-运行要求与兼容性)
11+
[![License](https://img.shields.io/badge/license-Apache-2.0-green)](https://www.apache.org/licenses/LICENSE-2.0)
12+
13+
[English](./README.md) | [简体中文](./README.zh-CN.md)
14+
15+
[项目定位](#1-项目定位) · [核心能力](#2-核心能力) ·
16+
[引入依赖](#5-引入依赖) · [快速开始](#6-快速开始) ·
17+
[配置参考](#7-配置参考) · [版本线](#8-版本线与兼容性) ·
18+
[构建测试](#9-构建与测试) · [许可证](#12-许可证)
19+
20+
</div>
21+
22+
---
23+
24+
> **当前版本**`1.0.0-SNAPSHOT`<br>
25+
> **JDK 基线**`17`<br>
26+
> **Group ID**`io.github.easy4j`<br>
27+
> **Artifact ID**`spring-boot-starter-samples`<br>
28+
> **许可证**:Apache License 2.0<br>
29+
30+
## 1. 项目定位
31+
32+
**spring-boot-starter-samples** 是一个面向 使用 spring-boot-samples 的应用 的 Spring Boot Starter,用于将 **spring-boot-samples** 集成到 Spring Boot 应用中。它提供自动装配、属性绑定与开箱即用的 Bean,使应用以最小配置即可使用 spring-boot-samples 的全部能力。
33+
34+
| 维度 | 说明 |
35+
|---|---|
36+
| 类型 | Spring Boot Starter |
37+
| 消费方 | 使用 spring-boot-samples 的 Spring Boot 应用 |
38+
| 核心能力 | 自动装配、属性绑定、开箱即用的 spring-boot-samples Bean |
39+
| JDK | `17` |
40+
| 坐标 | `io.github.easy4j:spring-boot-starter-samples:1.0.0-SNAPSHOT` |
41+
| 配置前缀 | `spring.boot.samples` |
42+
43+
## 2. 核心能力
44+
45+
| 能力 | 状态 | 说明 |
46+
|---|:---:|---|
47+
| 自动装配 | ✅ 稳定 | 自动注册 spring-boot-samples 相关 Bean |
48+
| 属性绑定 | ✅ 稳定 | 绑定 `spring.boot.samples.*``Properties` |
49+
| 开箱即用的 Bean | ✅ 稳定 | 通过 自动装配 自动注册 |
50+
51+
## 3. 运行要求与兼容性
52+
53+
| 依赖 | 最低版本 | 证据来源 |
54+
|---|---:|---|
55+
| JDK | `17` | `pom.xml` |
56+
| Spring Boot | `1.0.2-SNAPSHOT` | `pom.xml` parent |
57+
| Maven | `3.6+` | Maven Enforcer |
58+
59+
## 4. 自动装配
60+
61+
Starter 自动装配以下 Bean:
62+
63+
| Bean | 条件 | 缺失时行为 |
64+
|---|---|---|
65+
| `Object` | classpath + property | 不创建 |
66+
67+
自动装配注册:
68+
69+
- `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`(Spring Boot 2.7+ / 3.x / 4.x)
70+
- `META-INF/spring.factories`(Spring Boot 2.x 传统方式)
71+
72+
## 5. 引入依赖
73+
74+
```xml
75+
<dependency>
76+
<groupId>io.github.easy4j</groupId>
77+
<artifactId>spring-boot-starter-samples</artifactId>
78+
<version>1.0.0-SNAPSHOT</version>
79+
</dependency>
80+
```
81+
82+
无其他 easy4j 组件依赖。
83+
84+
## 6. 快速开始
85+
86+
### 6.1 引入依赖
87+
88+
`pom.xml` 中添加上述依赖。
89+
90+
### 6.2 配置
91+
92+
```yaml
93+
spring.boot.samples:
94+
enabled: true
95+
```
96+
97+
### 6.3 使用 Bean
98+
99+
```java
100+
@SpringBootApplication
101+
public class Application {
102+
public static void main(String[] args) {
103+
SpringApplication.run(Application.class, args);
104+
}
105+
}
106+
```
107+
108+
在业务代码中注入自动装配的 Bean:
109+
110+
```java
111+
@Autowired
112+
private Object bean;
113+
```
114+
115+
## 7. 配置参考
116+
117+
### 7.1 配置前缀
118+
119+
`spring.boot.samples`
120+
121+
### 7.2 配置项
122+
123+
| 属性 | 类型 | 默认值 | 必填 | 说明 | 敏感 |
124+
|---|---|---|:---:|---|:---:|
125+
| `spring.boot.samples.enabled` | boolean | `true` || 是否启用 Starter ||
126+
<!-- 更多属性见下方 -->
127+
128+
## 8. 版本线与兼容性
129+
130+
| 分支 | JDK | Spring Boot | 组件版本 | 状态 |
131+
|---|---:|---:|---|:---:|
132+
| `2.3.x` / `2.7.x` | `8+` | 2.3.x / 2.7.x | `1.0.x` | 维护中 |
133+
| `3.0.x` ~ `3.5.x` | `17` | 3.x | `2.0.x` | 维护中 |
134+
| `4.0.x` / `4.1.x` | `17+` | 4.x | `3.0.x` | 活跃开发 |
135+
136+
## 9. 构建与测试
137+
138+
```bash
139+
mvn clean verify
140+
mvn -pl spring-boot-starter-samples -am test
141+
```
142+
143+
## 10. 排障
144+
145+
| 症状 | 诊断 | 解决 |
146+
|---|---|---|
147+
| Bean 未创建 | 查看自动装配报告 | 确认 `spring.boot.samples.enabled=true` 与 classpath |
148+
| `ClassNotFoundException` | 缺少依赖 | 引入对应模块 |
149+
| 版本冲突 | `mvn dependency:tree` | 使用 BOM 统一版本 |
150+
151+
## 11. 贡献
152+
153+
1. Fork 本仓库。
154+
2. 创建特性分支。
155+
3. 提交前运行 `mvn clean verify`
156+
4. 提交 Pull Request。
157+
158+
## 12. 许可证
159+
160+
本项目采用 [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) 许可证。
161+
162+
---
163+
164+
<div align="center">
165+
166+
[返回顶部](#readme-top) · [问题反馈](https://github.com/easy-4-java/spring-boot-starter-samples/issues) · [仓库地址](https://github.com/easy-4-java/spring-boot-starter-samples)
167+
168+
</div>

0 commit comments

Comments
 (0)