Microsphere Projects for Spring Framework
The Microsphere Spring framework is built upon a sophisticated multi-layered architecture that enhances standard Spring Framework capabilities through modular extensions and advanced integration patterns. This architecture focuses on providing enhanced dependency injection, event processing, web endpoint management, and caching capabilities while maintaining seamless compatibility with existing Spring applications.
Microsphere Spring aims to address common challenges and limitations in Spring applications by offering:
- Enhanced bean lifecycle management with dependency analysis and parallel instantiation
- Extended configuration system with listenable environment and advanced property resolution
- Improved web framework capabilities for both Spring MVC and WebFlux
- Flexible event processing with interception mechanisms
- Integration with additional technologies like Google Guice and P6Spy for JDBC monitoring
Module | Purpose | Key Features |
---|---|---|
microsphere-spring-parent | Parent POM with dependency management | Centralized version control, dependency BOMs |
microsphere-spring-dependencies | External dependency versions | Framework compatibility matrix |
microsphere-spring-context | Core Spring Context enhancements | Bean utilities, configuration management |
microsphere-spring-web | Web framework extensions | Endpoint mapping, request handling |
microsphere-spring-webmvc | Spring MVC specific extensions | Controller enhancements, method support |
microsphere-spring-webflux | Reactive web extensions | WebFlux utilities, reactive patterns |
microsphere-spring-jdbc | Database access enhancements | Connection utilities, query support |
microsphere-spring-guice | Google Guice integration | Dependency injection bridge |
microsphere-spring-test | Testing framework integration | Test utilities, mocking support |
The easiest way to get started is by adding the Microsphere Spring BOM (Bill of Materials) to your project's pom.xml:
<dependencyManagement>
<dependencies>
...
<!-- Microsphere Spring Dependencies -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-dependencies</artifactId>
<version>${microsphere-spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
...
</dependencies>
</dependencyManagement>
${microsphere-spring.version}
has two branches:
Branches | Purpose | Latest Version |
---|---|---|
0.2.x | Compatible with Spring Framework 6.0.x - 6.2.x | 0.2.3 |
0.1.x | Compatible with Spring Framework 4.3.x - 5.3.x | 0.1.3 |
Then add the specific modules you need:
<dependencies>
<!-- Microsphere Spring Context -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-context</artifactId>
</dependency>
</dependencies>
- To add The Java Properties resource(located classpath
META-INF/test/a.properties
):
a=1
b=3
- To add the test class for
@ResourcePropertySource
:
@ExtendWith(SpringExtension.class)
@ContextConfiguration
@ResourcePropertySource(
name = "test-property-source",
value = "classpath*:/META-INF/test/*.properties",
autoRefreshed = true
)
class PropertySourceExtensionAttributesTest {
@Autowired
private Environment environment;
@Test
void test() {
assertEquals("1", environment.getProperty("a"));
}
}
If the resource
META-INF/test/a.properties
is modified, the@ResourcePropertySource
will be automatically refreshed, and theEnvironment
will be updated with the new property values.
You don't need to build from source unless you want to try out the latest code or contribute to the project.
To build the project, follow these steps:
- Clone the repository:
git clone https://github.com/microsphere-projects/microsphere-spring.git
- Build the source:
- Linux/MacOS:
./mvnw package
- Windows:
mvnw.cmd package
We welcome your contributions! Please read Code of Conduct before submitting a pull request.
- Before you log a bug, please search the issues to see if someone has already reported the problem.
- If the issue doesn't already exist, create a new issue.
- Please provide as much information as possible with the issue report.
- microsphere-spring-context
- microsphere-spring-web
- microsphere-spring-webmvc
- microsphere-spring-webflux
- microsphere-spring-jdbc
- microsphere-spring-guice
- microsphere-spring-test
The Microsphere Spring is released under the Apache License 2.0.