|
| 1 | +<a id="readme-top"></a> |
| 2 | + |
| 3 | +<div align="center"> |
| 4 | + |
1 | 5 | # spring-boot-starter-samples |
2 | | -spring-boot-starter-samples |
| 6 | + |
| 7 | +**Spring Boot Starter for spring-boot-samples** |
| 8 | + |
| 9 | +[](https://github.com/easy-4-java/spring-boot-starter-samples) |
| 10 | +[](#3-requirements-and-compatibility) |
| 11 | +[](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> |
0 commit comments