From 12a74afdbad3ecb39cb12f6dee808aef9fdbd36a Mon Sep 17 00:00:00 2001 From: Laurent Goujon Date: Wed, 6 Nov 2024 00:36:07 -0800 Subject: [PATCH] chore(java): bump arrow to 18.0.0 (#2293) Update arrow dependency from 15.0.0 to 18.0.0. As Apache Arrow now requires Java 11, Apache Arrow ADBC also now requires Java 11. Update Apache Parent pom to version 33 and take advantage of Java 9+ support. Clean up pom.xml files to remove duplicate or conflicting plugin version definition and/or configuration Update FlightSQL tests to use the FlightSQL Junit 5 extension. Update build and dev scripts, and documentation --- .env | 2 +- .github/workflows/java.yml | 2 +- .github/workflows/packaging.yml | 2 +- ci/scripts/java_build.sh | 4 - dev/release/verify-release-candidate.sh | 2 +- docs/source/development/releasing.rst | 2 +- java/driver/flight-sql/pom.xml | 7 -- .../driver/flightsql/GetObjectsTests.java | 27 +++---- .../adbc/driver/flightsql/MutualTlsTest.java | 22 +++--- .../arrow/adbc/driver/flightsql/TlsTest.java | 24 +++--- .../jdbc-validation-mssqlserver/pom.xml | 13 ---- java/pom.xml | 76 ++++--------------- 12 files changed, 58 insertions(+), 125 deletions(-) diff --git a/.env b/.env index 8f3288d488..d7ff7ad64d 100644 --- a/.env +++ b/.env @@ -28,7 +28,7 @@ ARCH_SHORT=amd64 ARCH_CONDA_FORGE=linux_64_ # Default versions for various dependencies -JDK=8 +JDK=11 MANYLINUX=2-28 MAVEN=3.6.3 PLATFORM=linux/amd64 diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index d33247f819..e2457f29c2 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: ['8', '11', '17', '21', '22'] + java: ['11', '17', '21', '22'] steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index cf3764d5f7..20d088da49 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -243,7 +243,7 @@ jobs: docs.tgz java: - name: "Java 1.8" + name: "Java 11" runs-on: ubuntu-latest needs: - source diff --git a/ci/scripts/java_build.sh b/ci/scripts/java_build.sh index 463fb4210e..ae004dcf16 100755 --- a/ci/scripts/java_build.sh +++ b/ci/scripts/java_build.sh @@ -36,11 +36,7 @@ main() { pushd ${source_dir}/java mvn -B clean \ install \ - assembly:single \ - source:jar \ - javadoc:jar \ -Papache-release \ - -DdescriptorId=source-release \ -T 2C \ -DskipTests \ -Dgpg.skip diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh index cb1107d4ec..a5b277560d 100755 --- a/dev/release/verify-release-candidate.sh +++ b/dev/release/verify-release-candidate.sh @@ -21,7 +21,7 @@ # Requirements # - Ruby >= 2.3 # - Maven >= 3.3.9 -# - JDK >=7 +# - JDK >= 11 # - gcc >= 4.8 # - Go >= 1.21 # - Docker diff --git a/docs/source/development/releasing.rst b/docs/source/development/releasing.rst index d370ae27fe..6d6130b8d1 100644 --- a/docs/source/development/releasing.rst +++ b/docs/source/development/releasing.rst @@ -218,7 +218,7 @@ How to Verify Release Candidates - GLib and gobject-introspection with headers - pkg-config or cmake must be able to find libarrow-glib.so - GI_TYPELIB_PATH should be set to the path to the girepository-1.0 directory - - Java JRE and JDK (Java 8+) + - Java JRE and JDK (Java 11+) - the javadoc command must also be accessible - Go - CMake, ninja-build, libpq (with headers), SQLite (with headers) diff --git a/java/driver/flight-sql/pom.xml b/java/driver/flight-sql/pom.xml index 9e8ce65ecd..49d79b114d 100644 --- a/java/driver/flight-sql/pom.xml +++ b/java/driver/flight-sql/pom.xml @@ -103,13 +103,6 @@ junit-vintage-engine test - - - junit - junit - 4.13.2 - test - org.apache.arrow flight-sql-jdbc-core diff --git a/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/GetObjectsTests.java b/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/GetObjectsTests.java index 454527b716..c0beba9e4b 100644 --- a/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/GetObjectsTests.java +++ b/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/GetObjectsTests.java @@ -38,7 +38,7 @@ import org.apache.arrow.adbc.core.AdbcDriver; import org.apache.arrow.adbc.core.AdbcException; import org.apache.arrow.adbc.drivermanager.AdbcDriverManager; -import org.apache.arrow.driver.jdbc.FlightServerTestRule; +import org.apache.arrow.driver.jdbc.FlightServerTestExtension; import org.apache.arrow.driver.jdbc.utils.MockFlightSqlProducer; import org.apache.arrow.flight.FlightProducer; import org.apache.arrow.flight.sql.FlightSqlProducer; @@ -58,19 +58,19 @@ import org.apache.arrow.vector.types.pojo.Field; import org.apache.arrow.vector.types.pojo.Schema; import org.apache.arrow.vector.util.Text; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; /** Test functions for returning database catalog information. */ public class GetObjectsTests { private static final BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE); private static final MockFlightSqlProducer FLIGHT_SQL_PRODUCER = new MockFlightSqlProducer(); - @ClassRule - public static final FlightServerTestRule FLIGHT_SERVER_TEST_RULE = - FlightServerTestRule.createStandardTestRule(FLIGHT_SQL_PRODUCER); + @RegisterExtension + public static FlightServerTestExtension FLIGHT_SERVER_TEST_EXTENSION = + FlightServerTestExtension.createStandardTestExtension(FLIGHT_SQL_PRODUCER); private static final int BASE_ROW_COUNT = 10; private static AdbcConnection connection; @@ -82,13 +82,14 @@ private enum ExpectedColumnSelection { ALL_COLUMNS } - @BeforeClass + @BeforeAll public static void setUpBeforeClass() throws AdbcException { - String uri = String.format("grpc+tcp://%s:%d", "localhost", FLIGHT_SERVER_TEST_RULE.getPort()); + String uri = + String.format("grpc+tcp://%s:%d", "localhost", FLIGHT_SERVER_TEST_EXTENSION.getPort()); Map params = new HashMap<>(); params.put(AdbcDriver.PARAM_URI.getKey(), uri); - params.put(AdbcDriver.PARAM_USERNAME.getKey(), FlightServerTestRule.DEFAULT_USER); - params.put(AdbcDriver.PARAM_PASSWORD.getKey(), FlightServerTestRule.DEFAULT_PASSWORD); + params.put(AdbcDriver.PARAM_USERNAME.getKey(), FlightServerTestExtension.DEFAULT_USER); + params.put(AdbcDriver.PARAM_PASSWORD.getKey(), FlightServerTestExtension.DEFAULT_PASSWORD); params.put(FlightSqlConnectionProperties.WITH_COOKIE_MIDDLEWARE.getKey(), true); AdbcDatabase db = AdbcDriverManager.getInstance() @@ -291,7 +292,7 @@ public static void setUpBeforeClass() throws AdbcException { commandGetTablesWithSchema, commandGetTablesWithSchemaResultProducer); } - @AfterClass + @AfterAll public static void tearDown() throws Exception { AutoCloseables.close(connection, FLIGHT_SQL_PRODUCER, allocator); } diff --git a/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/MutualTlsTest.java b/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/MutualTlsTest.java index f98a7c3470..17fa13fb24 100644 --- a/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/MutualTlsTest.java +++ b/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/MutualTlsTest.java @@ -30,21 +30,21 @@ import org.apache.arrow.adbc.core.AdbcException; import org.apache.arrow.adbc.core.AdbcStatusCode; import org.apache.arrow.adbc.drivermanager.AdbcDriverManager; -import org.apache.arrow.driver.jdbc.FlightServerTestRule; +import org.apache.arrow.driver.jdbc.FlightServerTestExtension; import org.apache.arrow.driver.jdbc.authentication.UserPasswordAuthentication; import org.apache.arrow.driver.jdbc.utils.FlightSqlTestCertificates; import org.apache.arrow.driver.jdbc.utils.MockFlightSqlProducer; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.util.AutoCloseables; -import org.junit.After; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; public class MutualTlsTest { - @ClassRule public static final FlightServerTestRule FLIGHT_SERVER_TEST_RULE; + @RegisterExtension public static FlightServerTestExtension FLIGHT_SERVER_TEST_EXTENSION; private static final String USER_1 = "user1"; private static final String PASS_1 = "pass1"; @@ -67,8 +67,8 @@ public class MutualTlsTest { UserPasswordAuthentication authentication = new UserPasswordAuthentication.Builder().user(USER_1, PASS_1).build(); - FLIGHT_SERVER_TEST_RULE = - new FlightServerTestRule.Builder() + FLIGHT_SERVER_TEST_EXTENSION = + new FlightServerTestExtension.Builder() .authentication(authentication) .useEncryption(certKey.cert, certKey.key) .useMTlsClientVerification(FlightSqlTestCertificates.exampleCACert()) @@ -79,7 +79,7 @@ public class MutualTlsTest { private BufferAllocator allocator; private Map params; - @Before + @BeforeEach public void setUp() { allocator = new RootAllocator(Long.MAX_VALUE); params = new HashMap<>(); @@ -87,7 +87,7 @@ public void setUp() { params.put(AdbcDriver.PARAM_PASSWORD.getKey(), PASS_1); } - @After + @AfterEach public void tearDown() throws Exception { AutoCloseables.close(allocator); } @@ -147,6 +147,6 @@ private String getUri(boolean withTls) { String protocol = String.format("grpc%s", withTls ? "+tls" : "+tcp"); return String.format( "%s://%s:%d", - protocol, FLIGHT_SERVER_TEST_RULE.getHost(), FLIGHT_SERVER_TEST_RULE.getPort()); + protocol, FLIGHT_SERVER_TEST_EXTENSION.getHost(), FLIGHT_SERVER_TEST_EXTENSION.getPort()); } } diff --git a/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/TlsTest.java b/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/TlsTest.java index 0301f3d8fb..bcfff64dd0 100644 --- a/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/TlsTest.java +++ b/java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/TlsTest.java @@ -30,21 +30,21 @@ import org.apache.arrow.adbc.core.AdbcException; import org.apache.arrow.adbc.core.AdbcStatusCode; import org.apache.arrow.adbc.drivermanager.AdbcDriverManager; -import org.apache.arrow.driver.jdbc.FlightServerTestRule; +import org.apache.arrow.driver.jdbc.FlightServerTestExtension; import org.apache.arrow.driver.jdbc.authentication.UserPasswordAuthentication; import org.apache.arrow.driver.jdbc.utils.FlightSqlTestCertificates; import org.apache.arrow.driver.jdbc.utils.MockFlightSqlProducer; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.util.AutoCloseables; -import org.junit.After; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; public class TlsTest { - @ClassRule public static final FlightServerTestRule FLIGHT_SERVER_TEST_RULE; + @RegisterExtension public static FlightServerTestExtension FLIGHT_SERVER_TEST_EXTENSION; private static final String USER_1 = "user1"; private static final String PASS_1 = "pass1"; @@ -59,8 +59,8 @@ public class TlsTest { UserPasswordAuthentication authentication = new UserPasswordAuthentication.Builder().user(USER_1, PASS_1).build(); - FLIGHT_SERVER_TEST_RULE = - new FlightServerTestRule.Builder() + FLIGHT_SERVER_TEST_EXTENSION = + new FlightServerTestExtension.Builder() .authentication(authentication) .useEncryption(certKey.cert, certKey.key) .producer(new MockFlightSqlProducer()) @@ -70,7 +70,7 @@ public class TlsTest { private BufferAllocator allocator; private Map params; - @Before + @BeforeEach public void setUp() { allocator = new RootAllocator(Long.MAX_VALUE); params = new HashMap<>(); @@ -78,7 +78,7 @@ public void setUp() { params.put(AdbcDriver.PARAM_PASSWORD.getKey(), PASS_1); } - @After + @AfterEach public void tearDown() throws Exception { AutoCloseables.close(allocator); } @@ -160,7 +160,7 @@ public void testClientTlsOnGoodHostnameOverride() throws Exception { params.put(AdbcDriver.PARAM_URI.getKey(), getUri(true)); params.put( FlightSqlConnectionProperties.TLS_OVERRIDE_HOSTNAME.getKey(), - FLIGHT_SERVER_TEST_RULE.getHost()); + FLIGHT_SERVER_TEST_EXTENSION.getHost()); try (InputStream stream = Files.newInputStream(Paths.get(TLS_ROOT_CERTS_PATH))) { params.put(FlightSqlConnectionProperties.TLS_ROOT_CERTS.getKey(), stream); AdbcDatabase db = @@ -174,6 +174,6 @@ private String getUri(boolean withTls) { String protocol = String.format("grpc%s", withTls ? "+tls" : "+tcp"); return String.format( "%s://%s:%d", - protocol, FLIGHT_SERVER_TEST_RULE.getHost(), FLIGHT_SERVER_TEST_RULE.getPort()); + protocol, FLIGHT_SERVER_TEST_EXTENSION.getHost(), FLIGHT_SERVER_TEST_EXTENSION.getPort()); } } diff --git a/java/driver/jdbc-validation-mssqlserver/pom.xml b/java/driver/jdbc-validation-mssqlserver/pom.xml index 218ab68660..3a23709249 100644 --- a/java/driver/jdbc-validation-mssqlserver/pom.xml +++ b/java/driver/jdbc-validation-mssqlserver/pom.xml @@ -72,17 +72,4 @@ test - - - - jdk8 - - 1.8 - - - - 12.4.1.jre8 - - - diff --git a/java/pom.xml b/java/pom.xml index d513080718..3f4aee32ef 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -23,7 +23,7 @@ org.apache apache - 18 + 33 org.apache.arrow.adbc @@ -96,9 +96,13 @@ - 15.0.0 + 18.0.0 3.48.2 - 0.15.0-SNAPSHOT + + 11 + 11 + 3.5.2 + 3.11.1 @@ -116,32 +120,32 @@ org.apache.arrow.adbc adbc-core - ${adbc.version} + ${project.version} org.apache.arrow.adbc adbc-driver-flight-sql - ${adbc.version} + ${project.version} org.apache.arrow.adbc adbc-driver-jdbc - ${adbc.version} + ${project.version} org.apache.arrow.adbc adbc-driver-validation - ${adbc.version} + ${project.version} org.apache.arrow.adbc adbc-driver-manager - ${adbc.version} + ${project.version} org.apache.arrow.adbc adbc-sql - ${adbc.version} + ${project.version} @@ -170,11 +174,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - 3.5.2 - com.diffplug.spotless spotless-maven-plugin @@ -186,11 +185,9 @@ org.apache.maven.plugins - maven-compiler-plugin - 3.13.0 + maven-surefire-plugin - 1.8 - 1.8 + --add-opens=java.base/java.nio=ALL-UNNAMED @@ -236,11 +233,9 @@ - + org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 all,-missing @@ -248,9 +243,7 @@ https://arrow.apache.org/docs/java/reference/ - 8 public - 1.8 @@ -272,39 +265,6 @@ - - jdk8 - - 8 - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - - - - jdk9+ - - [9,] - - - - - org.apache.maven.plugins - maven-surefire-plugin - - --add-opens=java.base/java.nio=ALL-UNNAMED - - - - - - errorprone @@ -312,11 +272,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 - 1.8 - 1.8 - UTF-8 -XDcompilePolicy=simple -Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=com.uber