diff --git a/.travis.yml b/.travis.yml index 9d239fb14..f1742ed25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ sudo: required dist: trusty jdk: - - oraclejdk8 + - oraclejdk11 services: - docker diff --git a/debezium-connector-mongodb/pom.xml b/debezium-connector-mongodb/pom.xml index 1c4a74711..a2598d5ae 100644 --- a/debezium-connector-mongodb/pom.xml +++ b/debezium-connector-mongodb/pom.xml @@ -246,6 +246,7 @@ org.apache.maven.plugins maven-assembly-plugin + ${version.assembly.plugin} io.debezium diff --git a/debezium-connector-mysql/pom.xml b/debezium-connector-mysql/pom.xml index 23c30e78a..e230a006f 100644 --- a/debezium-connector-mysql/pom.xml +++ b/debezium-connector-mysql/pom.xml @@ -349,6 +349,11 @@ + + org.apache.maven.plugins + maven-assembly-plugin + ${version.assembly.plugin} + @@ -433,6 +438,7 @@ org.apache.maven.plugins maven-failsafe-plugin + ${version.failsafe.plugin} ${skipITs} true diff --git a/debezium-connector-postgres/pom.xml b/debezium-connector-postgres/pom.xml index e5d116cee..1b0e23078 100644 --- a/debezium-connector-postgres/pom.xml +++ b/debezium-connector-postgres/pom.xml @@ -266,6 +266,7 @@ org.apache.maven.plugins maven-assembly-plugin + ${version.assembly.plugin} io.debezium diff --git a/debezium-connector-sqlserver/pom.xml b/debezium-connector-sqlserver/pom.xml index dce4fb0ce..eeba8a26f 100644 --- a/debezium-connector-sqlserver/pom.xml +++ b/debezium-connector-sqlserver/pom.xml @@ -225,6 +225,7 @@ org.apache.maven.plugins maven-assembly-plugin + ${version.assembly.plugin} io.debezium diff --git a/debezium-core/src/main/java/io/debezium/config/Instantiator.java b/debezium-core/src/main/java/io/debezium/config/Instantiator.java index 3c1d6ff87..3f82b13a2 100644 --- a/debezium-core/src/main/java/io/debezium/config/Instantiator.java +++ b/debezium-core/src/main/java/io/debezium/config/Instantiator.java @@ -30,7 +30,7 @@ static T getInstance(String className, Supplier classloaderSupp : Configuration.class.getClassLoader(); try { Class clazz = (Class) classloader.loadClass(className); - return configuration == null ? clazz.newInstance() + return configuration == null ? clazz.getDeclaredConstructor().newInstance() : clazz.getConstructor(Configuration.class).newInstance(configuration); } catch (ClassNotFoundException e) { diff --git a/debezium-core/src/main/java/io/debezium/jdbc/JdbcConnection.java b/debezium-core/src/main/java/io/debezium/jdbc/JdbcConnection.java index 0e3b65174..009971d4a 100644 --- a/debezium-core/src/main/java/io/debezium/jdbc/JdbcConnection.java +++ b/debezium-core/src/main/java/io/debezium/jdbc/JdbcConnection.java @@ -5,6 +5,7 @@ */ package io.debezium.jdbc; +import java.lang.reflect.InvocationTargetException; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DatabaseMetaData; @@ -176,10 +177,10 @@ public static ConnectionFactory patternBasedFactory(String urlPattern, String dr driverClassLoader = JdbcConnection.class.getClassLoader(); } Class driverClazz = (Class) Class.forName(driverClassName, true, driverClassLoader); - java.sql.Driver driver = driverClazz.newInstance(); + java.sql.Driver driver = driverClazz.getDeclaredConstructor().newInstance(); conn = driver.connect(url, props); } - catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) { + catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) { throw new SQLException(e); } LOGGER.debug("Connected to {} with {}", url, props); diff --git a/debezium-core/src/main/java/io/debezium/relational/mapping/ColumnMappers.java b/debezium-core/src/main/java/io/debezium/relational/mapping/ColumnMappers.java index 6f32a523e..4f3ccf726 100644 --- a/debezium-core/src/main/java/io/debezium/relational/mapping/ColumnMappers.java +++ b/debezium-core/src/main/java/io/debezium/relational/mapping/ColumnMappers.java @@ -275,7 +275,7 @@ protected boolean matches(ColumnId id) { protected static ColumnMapper instantiateMapper(Class clazz, Configuration config) { try { - ColumnMapper mapper = clazz.newInstance(); + ColumnMapper mapper = clazz.getDeclaredConstructor().newInstance(); if (config != null) { mapper.initialize(config); } diff --git a/debezium-core/src/test/java/io/debezium/junit/ConditionalFail.java b/debezium-core/src/test/java/io/debezium/junit/ConditionalFail.java index 6cf7d1e9f..303b94e66 100644 --- a/debezium-core/src/test/java/io/debezium/junit/ConditionalFail.java +++ b/debezium-core/src/test/java/io/debezium/junit/ConditionalFail.java @@ -5,6 +5,7 @@ */ package io.debezium.junit; +import java.lang.reflect.InvocationTargetException; import java.util.function.Supplier; import org.junit.Assert; @@ -27,7 +28,7 @@ public Statement apply(final Statement base, final Description description) { return base; } try { - Supplier condition = conditionClass.value().newInstance(); + Supplier condition = conditionClass.value().getDeclaredConstructor().newInstance(); return new Statement() { @Override public void evaluate() throws Throwable { @@ -50,7 +51,7 @@ else if (failure != null) { } }; } - catch (final InstantiationException | IllegalAccessException e) { + catch (final InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { throw new IllegalStateException(e); } } diff --git a/debezium-ddl-parser/pom.xml b/debezium-ddl-parser/pom.xml index 0a0bf3d5c..47ab7fb24 100644 --- a/debezium-ddl-parser/pom.xml +++ b/debezium-ddl-parser/pom.xml @@ -78,7 +78,7 @@ com.khubla.antlr antlr4test-maven-plugin - 1.10 + 1.11 false false diff --git a/debezium-embedded/src/main/java/io/debezium/embedded/EmbeddedEngine.java b/debezium-embedded/src/main/java/io/debezium/embedded/EmbeddedEngine.java index cba96a3a7..9653c4828 100644 --- a/debezium-embedded/src/main/java/io/debezium/embedded/EmbeddedEngine.java +++ b/debezium-embedded/src/main/java/io/debezium/embedded/EmbeddedEngine.java @@ -707,7 +707,7 @@ public void run() { try { @SuppressWarnings("unchecked") Class connectorClass = (Class) classLoader.loadClass(connectorClassName); - connector = connectorClass.newInstance(); + connector = connectorClass.getDeclaredConstructor().newInstance(); } catch (Throwable t) { fail("Unable to instantiate connector class '" + connectorClassName + "'", t); @@ -720,7 +720,7 @@ public void run() { try { @SuppressWarnings("unchecked") Class offsetStoreClass = (Class) classLoader.loadClass(offsetStoreClassName); - offsetStore = offsetStoreClass.newInstance(); + offsetStore = offsetStoreClass.getDeclaredConstructor().newInstance(); } catch (Throwable t) { fail("Unable to instantiate OffsetBackingStore class '" + offsetStoreClassName + "'", t); @@ -771,7 +771,7 @@ public void raiseError(Exception e) { Class taskClass = connector.taskClass(); task = null; try { - task = (SourceTask) taskClass.newInstance(); + task = (SourceTask) taskClass.getDeclaredConstructor().newInstance(); } catch (IllegalAccessException | InstantiationException t) { fail("Unable to instantiate connector's task class '" + taskClass.getName() + "'", t); diff --git a/debezium-embedded/src/test/java/io/debezium/embedded/ConnectorOutputTest.java b/debezium-embedded/src/test/java/io/debezium/embedded/ConnectorOutputTest.java index deacbfa39..9740a913e 100644 --- a/debezium-embedded/src/test/java/io/debezium/embedded/ConnectorOutputTest.java +++ b/debezium-embedded/src/test/java/io/debezium/embedded/ConnectorOutputTest.java @@ -622,7 +622,19 @@ protected TestSpecification usingSpec(String name) { * @return the test specification; never null */ protected TestSpecification usingSpec(String name, String directory) { - return usingSpec(name, Paths.get(directory)); + String version = System.getProperty("java.version"); + String modulePath = ""; + /** + * Java 11 seems to have issues finding the file when tests are invoked from the root directory. However, running + * the tests directory from the module directory work, so we only need to mess with the path when we are invoking + * the tests from the root. + */ + if (!version.startsWith("1.")) { + if (!Paths.get(directory).toAbsolutePath().toString().contains("debezium-embedded")) { + modulePath = "debezium-embedded/"; + } + } + return usingSpec(name, Paths.get(modulePath + directory)); } /** diff --git a/pom.xml b/pom.xml index d71596739..f621d866c 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ scm:git:git@github.com:debezium/debezium.git scm:git:git@github.com:debezium/debezium.git https://github.com/debezium/debezium - HEAD + HEAD jira @@ -53,17 +53,18 @@ UTF-8 1.8 1.8 + 8 2.3.1 2.12 - 2.11.0 + 4.2.0 3.4.14 2.10.0 1.7.26 1.2.17 - 5.1.2 + 5.3.1 42.2.8 @@ -78,28 +79,35 @@ 3.8.0 - 4.7 + 4.7.2 4.12 1.4 1.21 - 2.13.0 + 3.0.0 3.1.6 - 2.7 - 2.10 - 3.0.0-M1 + 3.8.1 + 3.1.0 + 3.1.1 + 3.1.1 + 3.0.0-M2 + 3.0.2 - 3.0.1 - 2.4 + 3.1.0 + 3.1.1 2.5 - 0.3.1 - 0.26.0 - 1.6.3 + 0.4 + 0.31.0 + 1.6.8 3.8.0 + 3.1.1 2.8.1 + 3.0.0-M3 + 3.0.0 + 2.5.3 1.2.0 @@ -108,6 +116,13 @@ true + + 2 + true + false @@ -119,16 +134,19 @@ sort - + - + - + connector-distribution + + + true @@ -170,7 +188,7 @@ ossrh - OSS Sonatype Nexus + OSS Sonatype Nexus https://oss.sonatype.org/content/groups/public/ true @@ -219,7 +237,7 @@ ${version.kafka} - + org.apache.kafka kafka_${version.kafka.scala} @@ -404,6 +422,11 @@ ${project.version} test-jar + + javax.xml.bind + jaxb-api + 2.3.1 + @@ -462,6 +485,11 @@ maven-resources-plugin ${version.resources.plugin} + + org.apache.maven.shared + maven-filtering + ${version.filtering.plugin} + org.apache.maven.plugins maven-dependency-plugin @@ -478,6 +506,7 @@ ${version.failsafe.plugin} ${debug.argline} ${modules.argline} ${test.argline} + ${useSystemClassLoader} @@ -626,7 +655,7 @@ - 3.0.0 + 3.0.5 @@ -672,6 +701,9 @@ false true + ${forkCount} + ${reuseForks} + ${useSystemClassLoader} @@ -821,12 +853,20 @@ - jdk9 + jdk11 - 9 + 11 - --add-modules java.xml.bind + --add-modules java.xml.bind --illegal-access=permit + 0 + false + false + + 11 + 11 + 11 diff --git a/support/checkstyle/pom.xml b/support/checkstyle/pom.xml index 282282dda..355593bfd 100644 --- a/support/checkstyle/pom.xml +++ b/support/checkstyle/pom.xml @@ -18,12 +18,11 @@ UTF-8 - 1.8 - 1.8 - 3.0.0-M1 + 3.0.0-M2 3.0.2 - 3.0.1 + 3.1.0 + 3.0.0