Skip to content

Commit

Permalink
add profile to run build & test under java 8~17
Browse files Browse the repository at this point in the history
  • Loading branch information
areyouok committed Oct 11, 2023
1 parent 4ebdca4 commit bce1963
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 33 deletions.
7 changes: 7 additions & 0 deletions jetcache-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import com.alicp.jetcache.support.KryoValueDecoder;
import com.alicp.jetcache.support.KryoValueEncoder;
import com.alicp.jetcache.test.external.AbstractExternalCacheTest;
import org.junit.Ignore;
import org.junit.Test;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
Expand All @@ -26,7 +29,8 @@
public class RedisSpringDataCacheTest extends AbstractExternalCacheTest {

@Test
// @Ignore("boot2.x need jedis 3.x")
@DisabledForJreRange(max = JRE.JAVA_16,
disabledReason = "in profile for java8 to 16, we use spring boot 2.x, it need jedis 3")
public void jedisTest() throws Exception {
JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
connectionFactory.afterPropertiesSet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import com.alicp.jetcache.SimpleCacheManager;
import com.alicp.jetcache.redis.AbstractBroadcastManagerTest;
import com.alicp.jetcache.support.BroadcastManager;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
Expand Down Expand Up @@ -45,7 +47,8 @@ public void testLettuce() throws Exception {
}

@Test
@Ignore("need jedis 3.x")
@DisabledForJreRange(max = JRE.JAVA_16,
disabledReason = "in profile for java8 to 16, we use spring boot 2.x, it need jedis 3")
public void testJedis() throws Exception {
RedisStandaloneConfiguration config = new RedisStandaloneConfiguration("127.0.0.1", 6379);
Constructor<JedisConnectionFactory> c = JedisConnectionFactory.class.getConstructor(RedisStandaloneConfiguration.class);
Expand Down
98 changes: 71 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>8</source>
<target>8</target>
<release>8</release>
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
Expand Down Expand Up @@ -224,28 +213,34 @@
-->

<jackson.version>2.15.2</jackson.version>
<junit.version>5.9.3</junit.version>
<slf4j.version>2.0.9</slf4j.version>
<logback.version>1.4.11</logback.version>
</properties>

<dependencyManagement>
<dependencies>

<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<!--<version>1.7.36</version>-->
<version>2.0.9</version>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<!--<version>1.2.11</version>-->
<version>1.4.11</version>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<!--<version>1.2.11</version>-->
<version>1.4.11</version>
<version>${logback.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -311,15 +306,6 @@
<version>2.9.3</version>
<!--3.0+ need java 11-->
</dependency>

<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>

</dependencies>
</dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -360,6 +346,64 @@
<url>https://github.com/alibaba/jetcache</url>
</scm>
<profiles>
<profile>
<id>compiler_java9+</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>8</source>
<target>8</target>
<release>8</release>
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>compiler_java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>8</source>
<target>8</target>
<!--
<release>8</release>
not supported in java 8 compiler
-->
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>spring_boot_2.x_for_java8_to_16</id>
<activation>
<jdk>(,16]</jdk>
</activation>
<properties>
<spring.framework.version>5.3.23</spring.framework.version>
<spring.boot.version>2.7.5</spring.boot.version>
<lettuce.version>6.1.10.RELEASE</lettuce.version>
<slf4j.version>1.7.36</slf4j.version>
<logback.version>1.2.11</logback.version>
</properties>
</profile>
<profile>
<id>release</id>
<build>
Expand Down

0 comments on commit bce1963

Please sign in to comment.