Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Downgrade library compatibility from Java 11 to Java 8 #4

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
45 changes: 27 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,6 @@
<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 +67,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 +80,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 +124,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 +162,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,14 +205,20 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-inline</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
Expand Down Expand Up @@ -494,15 +506,12 @@
</format>
</formats>
<java>
<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>
</palantirJavaFormat>
<formatAnnotations/>
<importOrder/>
Expand Down Expand Up @@ -568,7 +577,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
Loading