Skip to content

Commit

Permalink
Merge pull request #46 from mercyblitz/dev
Browse files Browse the repository at this point in the history
Merge '1.x'. branch
  • Loading branch information
mercyblitz authored Jan 3, 2025
2 parents 1d6b558 + fb32966 commit cf54af4
Show file tree
Hide file tree
Showing 243 changed files with 3,895 additions and 4,154 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ name: Maven Build

on:
push:
branches: [ "dev" ]
branches: [ 'dev' ]
pull_request:
branches: [ "main" , "release" ]
branches: [ 'release' ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '17' , '21' ]
maven-profile-spring-boot: [ 'spring-boot-3.0' , 'spring-boot-3.1' , 'spring-boot-3.2' , 'spring-boot-3.3' ]
maven-profile-spring-framework: [
'spring-framework-6.0' , 'spring-framework-6.1', 'spring-framework-6.2'
]
steps:
- name: Checkout Source
uses: actions/checkout@v4
Expand All @@ -38,6 +40,11 @@ jobs:
--update-snapshots
--file pom.xml
-Drevision=0.0.1-SNAPSHOT
-DargLine="${{ matrix.java >= 16 && '--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED' || '' }}"
-P${{ matrix.maven-profile-spring-boot }}
test
test
--activate-profiles test,coverage,${{ matrix.maven-profile-spring-framework }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: microsphere-projects/microsphere-spring
5 changes: 2 additions & 3 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
workflow_dispatch:
inputs:
revision:
description: 'The version to publish for Spring 6+ and JDK 17+'
description: 'The version to publish'
required: true
default: '2.0.0-SNAPSHOT'

Expand All @@ -41,11 +41,10 @@ jobs:
--batch-mode
--update-snapshots
--file pom.xml
-DargLine="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
-Drevision=${{ inputs.revision }}
-Dgpg.skip=true
-Prelease,ci
deploy
--activate-profiles release,ci
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# microsphere-spring
Microsphere Projects for Spring
> Microsphere Projects for Spring
[![Maven Build](https://github.com/microsphere-projects/microsphere-spring/actions/workflows/maven-build.yml/badge.svg)](https://github.com/microsphere-projects/microsphere-spring/actions/workflows/maven-build.yml)
[![Codecov](https://codecov.io/gh/microsphere-projects/microsphere-spring/branch/dev-1.x/graph/badge.svg)](https://app.codecov.io/gh/microsphere-projects/microsphere-spring)
![Maven](https://img.shields.io/maven-central/v/io.github.microsphere-projects/microsphere-spring.svg)
![License](https://img.shields.io/github/license/microsphere-projects/microsphere-spring.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/microsphere-projects/microsphere-spring.svg)](http://isitmaintained.com/project/microsphere-projects/microsphere-spring "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/microsphere-projects/microsphere-spring.svg)](http://isitmaintained.com/project/microsphere-projects/microsphere-spring "Percentage of issues still open")
45 changes: 45 additions & 0 deletions microsphere-spring-compatible/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-parent</artifactId>
<version>${revision}</version>
<relativePath>../microsphere-spring-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-compatible</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>Microsphere :: Spring :: Compatible</name>
<description>Microsphere Spring Compatible</description>

<dependencies>

<!-- JSR 305 -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<optional>true</optional>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.microsphere.spring.util;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

import static io.microsphere.util.ClassUtils.cast;

/**
* {@link ApplicationContext} Utilities
* The classes in this package or sub-packages are forked from the Spring Framework 5.3.x(latest),
* which will be used to be compatible with the lower versions of Spring Framework.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @author <a href="mailto:mercyblitz@gmail.com">Mercy<a/>
* @since 1.0.0
*/
public abstract class ApplicationContextUtils {

public static ConfigurableApplicationContext asConfigurableApplicationContext(ApplicationContext context) {
return cast(context, ConfigurableApplicationContext.class);
}

public static ApplicationContext asApplicationContext(BeanFactory beanFactory) {
return cast(beanFactory, ApplicationContext.class);
}
}
package org.springframework;
92 changes: 70 additions & 22 deletions microsphere-spring-context/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,23 @@
<optional>true</optional>
</dependency>

<!-- JSR 305 -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<optional>true</optional>
</dependency>

<!-- MicroSphere Core -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-java-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Spring Framework -->
Expand All @@ -42,26 +55,25 @@

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<artifactId>spring-context-support</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<artifactId>spring-beans</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-indexer</artifactId>
<artifactId>spring-aop</artifactId>
<optional>true</optional>
</dependency>

<!-- Spring Data Redis -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-context-indexer</artifactId>
<optional>true</optional>
</dependency>

Expand Down Expand Up @@ -94,8 +106,8 @@

<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

Expand All @@ -117,20 +129,56 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-test</artifactId>
<version>${revision}</version>
<scope>test</scope>
</dependency>


</dependencies>

<profiles>

<profile>
<id>spring-framework-6.0</id>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-indexer</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-compatible</artifactId>
<version>${revision}</version>
<optional>true</optional>
</dependency>
</dependencies>
</profile>

<profile>
<id>spring-framework-5.1</id>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-indexer</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</profile>

<profile>
<id>spring-framework-5.2</id>
<dependencies>

</dependencies>
</profile>

<profile>
<id>spring-framework-5.3</id>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-indexer</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
Loading

0 comments on commit cf54af4

Please sign in to comment.