Spring Boot Starter for docx4j
Positioning · Capabilities · Dependency · Quick Start · Configuration · Versions · Build · License
Current Version:
3.0.0-SNAPSHOT
JDK Baseline:17
Group ID:io.github.easy4j
Artifact ID:docx4j-spring-boot-starter
License:Apache License 2.0
docx4j-spring-boot-starter is a Spring Boot starter that integrates docx4j for applications using docx4j. It provides auto-configuration, property binding, and ready-to-use beans so that applications can consume docx4j capabilities with minimal setup.
| Dimension | Description |
|---|---|
| Type | Spring Boot Starter |
| Consumers | Spring Boot applications using docx4j |
| Core Capabilities | auto-configuration, property binding, ready-to-use beans for docx4j |
| JDK | 17 |
| Coordinates | io.github.easy4j:docx4j-spring-boot-starter:3.0.0-SNAPSHOT |
| Config Prefix | docx4j |
| Capability | Status | Description |
|---|---|---|
| Auto-configuration | ✅ Stable | Registers docx4j beans automatically |
| Property Binding | ✅ Stable | Binds docx4j.* to Docx4jBeetlTemplateProperties |
IPublicationErrorHandler bean |
✅ Stable | Auto-registered via Docx4jAutoConfiguration, Docx4jBeetlTemplateAutoConfiguration, Docx4jDocxTemplateAutoConfiguration, Docx4jFreemarkerTemplateAutoConfiguration, Docx4jHttlTemplateAutoConfiguration, Docx4jJetbrickTemplateAutoConfiguration, Docx4jRythmTemplateAutoConfiguration, Docx4jThymeleafTemplateAutoConfiguration, Docx4jVelocityTemplateAutoConfiguration, Docx4jWebitTemplateAutoConfiguration, Docx4jXhtmlTemplateAutoConfiguration |
| Dependency | Minimum | Evidence |
|---|---|---|
| JDK | 17 |
pom.xml |
| Spring Boot | 2.6.0 |
pom.xml parent |
| Maven | 3.6+ |
Maven Enforcer |
The starter auto-configures the following beans:
| Bean | Condition | Missing Behavior |
|---|---|---|
IPublicationErrorHandler |
classpath + property | not created |
ApplicationReadyFontMapperistener |
classpath + property | not created |
WordprocessingMLBeetlTemplate |
classpath + property | not created |
WordprocessingMLDocxTemplate |
classpath + property | not created |
ConversionHyperlinkHandler |
classpath + property | not created |
ConversionHTMLStyleElementHandler |
classpath + property | not created |
ConversionHTMLScriptElementHandler |
classpath + property | not created |
WordprocessingMLPackageExtractor |
classpath + property | not created |
WordprocessingMLPackageWriter |
classpath + property | not created |
WordprocessingMLTemplateWriter |
classpath + property | not created |
WordprocessingMLFreemarkerTemplate |
classpath + property | not created |
WordprocessingMLHttlTemplate |
classpath + property | not created |
WordprocessingMLJetbrickTemplate |
classpath + property | not created |
WordprocessingMLRythmTemplate |
classpath + property | not created |
WordprocessingMLThymeleafTemplate |
classpath + property | not created |
WordprocessingMLVelocityTemplate |
classpath + property | not created |
WordprocessingMLWebitTemplate |
classpath + property | not created |
DocumentHandler |
classpath + property | not created |
WordprocessingMLPackageBuilder |
classpath + property | not created |
WordprocessingMLHtmlTemplate |
classpath + property | not created |
Auto-configuration registration:
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports(Spring Boot 2.7+ / 3.x / 4.x)META-INF/spring.factories(Spring Boot 2.x legacy)
<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>docx4j-spring-boot-starter</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>No additional easy4j component dependencies.
Add the dependency above to your pom.xml.
docx4j:
enabled: true@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}Then inject the auto-configured bean in your code:
@Autowired
private IPublicationErrorHandler errorHandler;docx4j
| Property | Type | Default | Required | Description | Sensitive |
|---|---|---|---|---|---|
docx4j.enabled |
boolean | true |
No | Enable the starter | No |
| Branch | JDK | Spring Boot | Component Version | Status |
|---|---|---|---|---|
2.3.x / 2.7.x |
8+ |
2.3.x / 2.7.x | 1.0.x |
Maintenance |
3.0.x ~ 3.5.x |
17 |
3.x | 2.0.x |
Maintenance |
4.0.x / 4.1.x |
17+ |
4.x | 3.0.x |
Active |
mvn clean verify
mvn -pl docx4j-spring-boot-starter -am test| Symptom | Diagnosis | Resolution |
|---|---|---|
| Bean not created | Check auto-configuration report | Verify docx4j.enabled=true and classpath |
ClassNotFoundException |
Missing dependency | Add the required module |
| Version conflict | mvn dependency:tree |
Use BOM for version alignment |
- Fork the repository.
- Create a feature branch.
- Run
mvn clean verifybefore submitting. - Submit a pull request.
This project is licensed under the Apache License, Version 2.0.