Skip to content

Commit

Permalink
Merge pull request #20 from microsphere-projects/dev-1.x
Browse files Browse the repository at this point in the history
Merge from the branch dev-1.x
  • Loading branch information
mercyblitz authored Aug 15, 2024
2 parents 09f7506 + 7058dc6 commit b963193
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 85 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
strategy:
matrix:
java: [ '8', '11' , '17' , '21' ]
maven-profile-spring-boot: [ 'spring-boot-2.7' ]
steps:
- name: Checkout Source
uses: actions/checkout@v4
Expand All @@ -32,10 +33,11 @@ jobs:
cache: maven

- name: Build with Maven
run: mvn
--batch-mode
--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' || '' }}"
run: mvn
--batch-mode
--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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.DependencyDescriptor;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import org.springframework.lang.Nullable;

import java.time.Duration;
import java.util.concurrent.CompletableFuture;

import static io.microsphere.reflect.MethodUtils.invokeMethod;
import static io.microsphere.spring.cache.TTLContext.doWithTTL;

/**
Expand All @@ -46,12 +48,22 @@ public void put(String name, byte[] key, byte[] value, Duration ttl) {
}, ttl);
}

public CompletableFuture<Void> store(String name, byte[] key, byte[] value, Duration ttl) {
// Compatible with Spring Data Redis < 3.2
return invokeMethod(delegate, "store", name, key, value, ttl);
}

@Override
@Nullable
public byte[] get(String name, byte[] key) {
return delegate.get(name, key);
}

public CompletableFuture<byte[]> retrieve(String name, byte[] key, Duration ttl) {
// Compatible with Spring Data Redis < 3.2
return invokeMethod(delegate, "retrieve", name, key, ttl);
}

@Override
@Nullable
public byte[] putIfAbsent(String name, byte[] key, byte[] value, Duration ttl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ protected Yaml createYaml() {
loaderOptions.setProcessComments(true);
loaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE);
loaderOptions.setAllowRecursiveKeys(true);
return new Yaml(new FilteringConstructor(loaderOptions), new Representer(),
new DumperOptions(), loaderOptions);
DumperOptions dumperOptions = new DumperOptions();
return new Yaml(new FilteringConstructor(loaderOptions), new Representer(dumperOptions), dumperOptions, loaderOptions);
}

private class FilteringConstructor extends Constructor {
Expand Down
49 changes: 11 additions & 38 deletions microsphere-spring-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,11 @@
<properties>
<microsphere-java.version>0.0.6</microsphere-java.version>
<spring-boot.version>2.7.18</spring-boot.version>
<sqlite-jdbc.version>3.36.0.3</sqlite-jdbc.version>
<mariadb-java-client.version>2.7.12</mariadb-java-client.version>
<mariadb4j.version>2.5.3</mariadb4j.version>
<embedded-redis.version>0.6</embedded-redis.version>
<lettuce.version>6.1.10.RELEASE</lettuce.version>
</properties>

<dependencyManagement>
<dependencies>
<!-- Spring Boot Dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Microsphere Dependencies -->
<dependency>
Expand All @@ -47,42 +36,26 @@
<scope>import</scope>
</dependency>

<!-- Spring Boot Dependencies -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>${sqlite-jdbc.version}</version>
</dependency>

<!-- MariaDB Connector/J-->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb-java-client.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- MariaDB4j -->
<!-- Lettuce -->
<dependency>
<groupId>ch.vorburger.mariaDB4j</groupId>
<artifactId>mariaDB4j</artifactId>
<version>${mariadb4j.version}</version>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>${lettuce.version}</version>
</dependency>

<dependency>
<groupId>com.github.kstyrc</groupId>
<artifactId>embedded-redis</artifactId>
<version>${embedded-redis.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<profiles>
<profile>
<id>spring-boot-1.5</id>
<properties>
<spring-boot.version>1.5.22.RELEASE</spring-boot.version>
</properties>
</profile>

<profile>
<id>spring-boot-2.0</id>
<properties>
Expand Down
73 changes: 36 additions & 37 deletions microsphere-spring-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@

<properties>
<zookeeper.version>3.8.1</zookeeper.version>
<wix-embedded-mysql.version>4.6.2</wix-embedded-mysql.version>
<sqlite-jdbc.version>3.36.0.3</sqlite-jdbc.version>
<mysql-connection-j.version>8.0.33</mysql-connection-j.version>
<mariadb-java-client.version>2.7.12</mariadb-java-client.version>
<mariadb4j.version>2.5.3</mariadb4j.version>
<embedded-redis.version>0.6</embedded-redis.version>
<xmlunit.version>2.9.1</xmlunit.version>
</properties>

<dependencies>
Expand All @@ -45,6 +50,7 @@
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-assertj</artifactId>
<version>${xmlunit.version}</version>
</dependency>

<!-- Spring Framework -->
Expand All @@ -71,6 +77,35 @@
<dependency>
<groupId>com.github.kstyrc</groupId>
<artifactId>embedded-redis</artifactId>
<version>${embedded-redis.version}</version>
</dependency>

<!-- SQLLite -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>${sqlite-jdbc.version}</version>
</dependency>

<!-- MySQL JDBC Driver -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql-connection-j.version}</version>
</dependency>

<!-- MariaDB Connector/J-->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb-java-client.version}</version>
</dependency>

<!-- MariaDB4j -->
<dependency>
<groupId>ch.vorburger.mariaDB4j</groupId>
<artifactId>mariaDB4j</artifactId>
<version>${mariadb4j.version}</version>
</dependency>

<!-- Spring Redis -->
Expand Down Expand Up @@ -98,48 +133,12 @@
<artifactId>spring-kafka-test</artifactId>
</dependency>

<!-- SQLite -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
</dependency>

<!-- Embedded MySQL -->
<dependency>
<groupId>com.wix</groupId>
<artifactId>wix-embedded-mysql</artifactId>
<version>${wix-embedded-mysql.version}</version>
</dependency>

<!-- MariaDB Connector/J-->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>

<!-- MariaDB4j -->
<dependency>
<groupId>ch.vorburger.mariaDB4j</groupId>
<artifactId>mariaDB4j</artifactId>
</dependency>

<!-- MySQL JDBC Driver -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>

</dependencies>

</project>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</scm>

<properties>
<revision>0.0.3</revision>
<revision>0.0.4-SNAPSHOT</revision>
</properties>

<modules>
Expand Down

0 comments on commit b963193

Please sign in to comment.