Boost Spring Boot 3.x Compatibility with mica-auto Auto-Generated Starter Configs
This article introduces mica-auto, an annotation‑processor‑based tool that automatically generates Spring Boot starter configuration files—including spring.factories, AutoConfiguration.imports, and java SPI settings—enabling seamless compatibility with Spring Boot 3.x without maintaining separate branches.
1. Introduction
Many open‑source developers create separate branches to keep their starters compatible with Spring Boot 3.x, but this is unnecessary if you avoid the renamed JARs. Using mica-auto can save maintenance and publishing time, giving you more freedom to spend with family and friends.
2. Overview
mica-auto (a Spring Boot starter development tool) generates Spring Boot starter configuration files. It uses an Annotation Processor to scan
@Componentat compile time and automatically produce the corresponding configuration. mica-auto supports composite annotations and is widely used in the mica, mica‑mqtt, pig, and SpringBlade ecosystems.
3. Features
Automatically generates
spring.factoriesduring compilation.
Automatically generates the Spring Boot 3.x
AutoConfiguration.importsSPI configuration.
Automatically generates
spring-devtools.propertiesduring compilation.
Automatically generates Java SPI configuration, requiring the
@AutoServiceannotation.
4. Usage
Note:If your project uses
Lombok, place the
mica-autodependency after the
Lombokdependency.
Maven
<code><dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-auto</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
</code>Gradle >= 5.x
<code>annotationProcessor("net.dreamlu:mica-auto:2.3.3")
</code>Gradle < 5.x
<code>compileOnly "net.dreamlu:mica-auto:2.3.3"
</code>5. Result
6. Conclusion
mica-auto simultaneously generates
spring.factoriesand the 3.x
AutoConfiguration.importsSPI configuration. Both can coexist without conflict, allowing existing starters to be compatible with Spring Boot 3.x without branching or maintaining multiple packages.
To better support Spring Boot 3.2.x, you may also need to add the
-parameterscompilation flag:
Maven configuration for this flag is shown in the following image:
Using mica-auto to auto‑generate Spring Boot starter configurations frees your hands, prevents missing or incorrect settings, and reduces startup failures. Give it a try today!
Java Architecture Diary
Committed to sharing original, high‑quality technical articles; no fluff or promotional content.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.