Skip to content

Commit

Permalink
feat: Downgrade library compatibility from Java 11 to Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneidereit committed Dec 9, 2024
1 parent 6248a3f commit bf4aeec
Show file tree
Hide file tree
Showing 60 changed files with 894 additions and 564 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up JDK 11
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Get hyperd version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ src/main/resources/config/config.properties

*.iml
pom.xml.bak
.codegenie
49 changes: 31 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,39 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.salesforce.datacloud</groupId>
<artifactId>jdbc</artifactId>
<version>0.21.0-SNAPSHOT</version>
<version>0.22.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Salesforce Data Cloud JDBC Driver</name>
<description>Salesforce Data Cloud JDBC Driver</description>
<properties>
<arrow.version>18.0.0</arrow.version>
<arrow.version>17.0.0</arrow.version>
<assertj.version>3.26.3</assertj.version>
<avatica.version>1.25.0</avatica.version>
<commons-lang3.version>3.17.0</commons-lang3.version>
<download.cache.directory>${project.build.directory}/.cache</download.cache.directory>
<git-build-hook-maven-plugin.version>3.5.0</git-build-hook-maven-plugin.version>
<grpc.version>1.68.1</grpc.version>
<grpcmock-junit5.version>0.13.0</grpcmock-junit5.version>
<guava.version>33.2.1-jre</guava.version>
<!-- https://tableau.github.io/hyper-db/docs/releases#download -->
<hyperapi.version>0.0.20746.reac9bd2d</hyperapi.version>
<hyperd.directory>${project.build.directory}/hyper</hyperd.directory>
<jackson.version>2.18.0</jackson.version>
<jacoco.maven.plugin.version>0.8.12</jacoco.maven.plugin.version>
<java.version>11</java.version>
<java.version>1.8</java.version>
<jjwt.version>0.12.6</jjwt.version>
<junit-bom.version>5.11.3</junit-bom.version>
<lombok.version>1.18.34</lombok.version>
<maven.compiler.source>{java.version}</maven.compiler.source>
<maven.compiler.target>{java.version}</maven.compiler.target>
<mockito-bom.version>5.14.1</mockito-bom.version>
<mockito-bom.version>4.11.0</mockito-bom.version>
<okhttp.version>4.12.0</okhttp.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<protobuf.version>3.25.5</protobuf.version>
<shadeBase>com.salesforce.datacloud.jdbc.internal.shaded</shadeBase>
<slf4j.version>1.7.32</slf4j.version>
<spotless.version>2.43.0</spotless.version>
<spotless.version>2.30.0</spotless.version>
</properties>
<dependencyManagement>
<dependencies>
Expand All @@ -52,13 +53,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-bom</artifactId>
<version>${arrow.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.arrow</groupId>-->
<!-- <artifactId>arrow-bom</artifactId>-->
<!-- <version>${arrow.version}</version>-->
<!-- <type>pom</type>-->
<!-- <scope>import</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
Expand All @@ -73,6 +74,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-bom</artifactId>
<version>${guava.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand All @@ -81,6 +87,11 @@
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
Expand Down Expand Up @@ -120,6 +131,7 @@
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
<version>${arrow.version}</version>
</dependency>
<dependency>
<groupId>org.apache.calcite.avatica</groupId>
Expand Down Expand Up @@ -157,6 +169,7 @@
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<version>${arrow.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -199,7 +212,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-inline</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -494,15 +507,15 @@
</format>
</formats>
<java>
<toggleOffOn/>
<!-- <toggleOffOn/>-->
<includes>
<include>src/main/java/**/*.java</include>
<include>src/test/java/**/*.java</include>
</includes>
<palantirJavaFormat>
<version>2.39.0</version>
<style>PALANTIR</style>
<formatJavadoc>true</formatJavadoc>
<version>1.1.0</version>
<!-- <style>PALANTIR</style>-->
<!-- <formatJavadoc>true</formatJavadoc>-->
</palantirJavaFormat>
<formatAnnotations/>
<importOrder/>
Expand Down Expand Up @@ -568,7 +581,7 @@
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>3.4.1</version>
<version>3.0.1</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<predefinedSortOrder>custom_1</predefinedSortOrder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static com.salesforce.datacloud.jdbc.util.PropertiesExtensions.optional;
import static com.salesforce.datacloud.jdbc.util.PropertiesExtensions.required;

import com.google.common.collect.ImmutableSet;
import com.salesforce.datacloud.jdbc.config.DriverVersion;
import com.salesforce.datacloud.jdbc.exception.DataCloudJDBCException;
import com.salesforce.datacloud.jdbc.util.PropertiesExtensions;
Expand Down Expand Up @@ -84,7 +85,7 @@ private static void checkHasAllRequired(Properties properties) throws SQLExcepti
}

val missing = Keys.REQUIRED_KEYS.stream()
.filter(k -> optional(properties, k).isEmpty())
.filter(k -> !optional(properties, k).isPresent())
.collect(Collectors.joining(", ", Messages.PROPERTIES_REQUIRED, ""));

throw new DataCloudJDBCException(missing, "28000", new IllegalArgumentException(missing));
Expand Down Expand Up @@ -136,15 +137,15 @@ protected static class Keys {
static final String USER_AGENT = "User-Agent";
static final String REFRESH_TOKEN = "refreshToken";

static final Set<String> REQUIRED_KEYS = Set.of(LOGIN_URL, CLIENT_ID, CLIENT_SECRET);
static final Set<String> REQUIRED_KEYS = ImmutableSet.of(LOGIN_URL, CLIENT_ID, CLIENT_SECRET);

static final Set<String> OPTIONAL_KEYS = Set.of(DATASPACE, USER_AGENT, MAX_RETRIES);
static final Set<String> OPTIONAL_KEYS = ImmutableSet.of(DATASPACE, USER_AGENT, MAX_RETRIES);

static final Set<String> PASSWORD_KEYS = Set.of(USER_NAME, PASSWORD);
static final Set<String> PASSWORD_KEYS = ImmutableSet.of(USER_NAME, PASSWORD);

static final Set<String> PRIVATE_KEY_KEYS = Set.of(USER_NAME, PRIVATE_KEY);
static final Set<String> PRIVATE_KEY_KEYS = ImmutableSet.of(USER_NAME, PRIVATE_KEY);

static final Set<String> REFRESH_TOKEN_KEYS = Set.of(REFRESH_TOKEN);
static final Set<String> REFRESH_TOKEN_KEYS = ImmutableSet.of(REFRESH_TOKEN);

static final Set<String> ALL = Stream.of(
REQUIRED_KEYS, OPTIONAL_KEYS, PASSWORD_KEYS, PRIVATE_KEY_KEYS, REFRESH_TOKEN_KEYS)
Expand Down
Loading

0 comments on commit bf4aeec

Please sign in to comment.