Dependency Management for Consistent Versioning
Bus BOM (Bill of Materials) is a Maven POM module that provides centralized dependency management for all Bus framework modules. It ensures version consistency across your project by managing all Bus library dependencies in one place.
- Centralized Version Management: Single source of truth for all Bus library versions
- Consistent Dependencies: Ensures compatible versions across all Bus modules
- Simplified Configuration: No need to specify versions for individual dependencies
- Easy Upgrades: Update all Bus modules by changing a single version
- Conflict Prevention: Avoids version conflicts between Bus modules
Import the BOM in your project's pom.xml:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-bom</artifactId>
<version>8.x.x</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>After importing the BOM, add Bus dependencies without specifying versions:
<dependencies>
<!-- Core module -->
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-core</artifactId>
</dependency>
<!-- Additional modules -->
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-fabric</artifactId>
</dependency>
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-health</artifactId>
</dependency>
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-mapper</artifactId>
</dependency>
</dependencies>For Spring Boot projects, you can combine with Spring Boot's BOM:
<dependencyManagement>
<dependencies>
<!-- Spring Boot BOM -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>4.x.x</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Bus BOM -->
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-bom</artifactId>
<version>8.x.x</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>The Bus BOM manages versions for all Bus framework modules:
- bus-core: Core utilities and tools
- bus-base: Base module
- bus-extra: Extension utilities
- bus-mapper: MyBatis enhancement
- bus-fabric: HTTP client and socket/WebSocket support
- bus-logger: Logging framework
- bus-cache: Caching abstraction
- bus-validate: Validation framework
- bus-crypto: Cryptography utilities
- bus-auth: Authentication and authorization
- bus-sensitive: Sensitive data masking
- bus-image: Image processing
- bus-office: Office document handling
- bus-tempus: Scheduled tasks
- bus-pay: Payment integration
- bus-notify: Notification service
- bus-storage: Storage abstraction
- bus-vortex: API gateway
- bus-limiter: Rate limiting and degradation
- bus-tracer: Distributed tracing
- bus-proxy: Dynamic proxy
- bus-setting: Configuration management
- bus-shade: JAR encryption
- bus-starter: Spring Boot starter
- bus-parent: Parent POM
- bus-gitlab: GitLab integration
- bus-opencv: OpenCV integration
- bus-health: Health checks
- bus-tempus: Cron scheduler
Recommended:
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-core</artifactId>
<!-- No version specified -->
</dependency>Not Recommended:
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-core</artifactId>
<version>8.x.x</version>
</dependency>Import the Bus BOM before other dependency management blocks to ensure proper precedence.
If you need to override a specific version (not recommended):
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-core</artifactId>
<version>8.x.x</version>
</dependency>Update all Bus modules simultaneously by changing the BOM version:
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-bom</artifactId>
<version>8.x.x</version> <!-- Update this version -->
<type>pom</type>
<scope>import</scope>
</dependency>To see which versions are managed by the BOM, you can:
mvn help:effective-pomOr check the actual bus-bom/pom.xml file:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.miaixz</groupId>
<artifactId>bus-core</artifactId>
<version>8.x.x</version>
</dependency>
</dependencies>
</dependencyManagement>If you encounter version conflicts:
- Check
mvn dependency:treeto see which versions are being used - Ensure the BOM is imported before other dependency management
- Check if other libraries are overriding Bus versions
- Explicitly exclude conflicting dependencies
If a dependency is not found:
- Verify the BOM version is correct
- Check that the module exists in the Bus framework
- Ensure your Maven repository configuration is correct
| Bus BOM Version | Spring Boot Version | JDK Version |
|---|---|---|
| 8.x | 4.x+ | 17+ |
| 6.x | 2.x+ | 11+ |
A: While not strictly required, it's highly recommended to ensure version compatibility.
A: Yes, but it's not recommended as it may lead to compatibility issues.
A: Use the latest stable version compatible with your Spring Boot and JDK versions.
A: This is not recommended. Use a single BOM version for all Bus dependencies.
Contributions are welcome! Please feel free to submit a Pull Request.