diff --git a/.copyrightconfig b/.copyrightconfig index 97d4035..565c937 100644 --- a/.copyrightconfig +++ b/.copyrightconfig @@ -1,7 +1,7 @@ # COPYRIGHT VALIDATION CONFIG # --------------------------------- # Required start year (keep fixed; end year auto-updates in check output) -startyear: 2023 +startyear: 2019 # Optional exclusions list (comma-separated). Leave commented if none. # Rules: diff --git a/build.gradle b/build.gradle index d46ea88..30c1c8c 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ plugins { // Only used for testing id 'jacoco' - id "org.sonarqube" version "5.1.0.4882" + id "org.sonarqube" version "6.3.1.5724" // Used to generate Avro classes. This will write classes to build/generated-test-avro-java and also add that folder // as a source root. Since this is commented out by default, the generated Avro test class has been added to @@ -34,10 +34,11 @@ java { targetCompatibility = JavaVersion.VERSION_17 } - - repositories { mavenCentral() + maven { + url = "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/" + } } configurations { @@ -46,11 +47,6 @@ configurations { configureEach { resolutionStrategy { - // Force v4.5.0 of commons-collections4 to avoid CVEs in v4.4.0 from transitive dependecies: - // CVE-2025-48924 (https://www.cve.org/CVERecord?id=CVE-2025-48924) and - // CVE-2020-15250 (https://www.cve.org/CVERecord?id=CVE-2020-15250) - force "org.apache.commons:commons-collections4:4.5.0" - // Force v3.19 of commons-lang3 to avoid CVE-2025-48924 (https://www.cve.org/CVERecord?id=CVE-2025-48924), which // is caused by the use of avro-compiler v1.12.0 with older dependencies including commons-lang3 v3.12.0. force 'org.apache.commons:commons-lang3:3.19.0' @@ -86,7 +82,7 @@ dependencies { compileOnly kafkaConnectRuntime // Force DHF to use the latest version of ml-gradle, which minimizes security vulnerabilities - implementation "com.marklogic:ml-gradle:6.0.1" + implementation "com.marklogic:ml-gradle:6.1-SNAPSHOT" implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.19.0" diff --git a/docker-compose.yml b/docker-compose.yml index 2f769e2..49ced7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ --- -name: docker-tests-marklogic-kafka-confluent +name: docker-tests-marklogic-kafka services: marklogic: image: "${MARKLOGIC_IMAGE}" diff --git a/src/main/java/com/marklogic/kafka/connect/source/XmlPlanInvoker.java b/src/main/java/com/marklogic/kafka/connect/source/XmlPlanInvoker.java index db568aa..8f3a4a7 100644 --- a/src/main/java/com/marklogic/kafka/connect/source/XmlPlanInvoker.java +++ b/src/main/java/com/marklogic/kafka/connect/source/XmlPlanInvoker.java @@ -17,11 +17,7 @@ import org.w3c.dom.NodeList; import javax.xml.XMLConstants; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; +import javax.xml.transform.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import java.io.StringWriter; @@ -31,7 +27,7 @@ class XmlPlanInvoker extends AbstractPlanInvoker implements PlanInvoker { - private static final Logger logger = LoggerFactory.getLogger(XmlPlanInvoker.class); + private static final Logger staticLogger = LoggerFactory.getLogger(XmlPlanInvoker.class); private static final String TABLE_NS_URI = "http://marklogic.com/table"; @@ -83,7 +79,7 @@ private String getKeyFromRow(Node row) { NamedNodeMap attributes = column.getAttributes(); // The 'name' attribute is expected to exist; trust but verify if (attributes != null && attributes.getNamedItem("name") != null && - keyColumn.equals(attributes.getNamedItem("name").getTextContent())) { + keyColumn.equals(attributes.getNamedItem("name").getTextContent())) { return column.getTextContent(); } } @@ -128,7 +124,7 @@ private static TransformerFactory makeNewTransformerFactory() { private static void logTransformerFactoryWarning(String xmlConstant, String errorMessage) { String baseTransformerFactoryWarningMessage = "Unable to set {} on TransformerFactory; cause: {}"; - logger.warn(baseTransformerFactoryWarningMessage, xmlConstant, errorMessage); + staticLogger.warn(baseTransformerFactoryWarningMessage, xmlConstant, errorMessage); } } diff --git a/test-app/build.gradle b/test-app/build.gradle index df72f42..28f824e 100644 --- a/test-app/build.gradle +++ b/test-app/build.gradle @@ -6,40 +6,40 @@ plugins { // Tasks for working with Confluent Platform running locally. // See "Testing with Confluent Platform" in CONTRIBUTING.md -task loadDatagenPurchasesConnector(type: Exec) { +tasks.register("loadDatagenPurchasesConnector", Exec) { description = "Load an instance of the Datagen connector into Confluent Platform for sending JSON documents to " + "the 'purchases' topic" commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json", "--data", "@ConfluentConnectorConfigs/datagen-purchases-source.json", "http://localhost:8083/connectors" } -task loadMarkLogicPurchasesSinkConnector(type: Exec) { +tasks.register("loadMarkLogicPurchasesSinkConnector", Exec) { description = "Load an instance of the MarkLogic Kafka connector into Confluent Platform for writing data to " + "MarkLogic from the 'purchases' topic" commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json", "--data", "@ConfluentConnectorConfigs/marklogic-purchases-sink.json", "http://localhost:8083/connectors" } -task loadMarkLogicPurchasesSourceConnector(type: Exec) { +tasks.register("loadMarkLogicPurchasesSourceConnector", Exec) { description = "Load an instance of the MarkLogic Kafka connector into Confluent Platform for reading rows from " + "the demo/purchases view" commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json", "--data", "@ConfluentConnectorConfigs/marklogic-purchases-source.json", "http://localhost:8083/connectors" } -task loadMarkLogicAuthorsSourceConnector(type: Exec) { +tasks.register("loadMarkLogicAuthorsSourceConnector", Exec) { description = "Loads a source connector that retrieves authors from the citations.xml file, which is also used for " + "all the automated tests" commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json", "--data", "@ConfluentConnectorConfigs/marklogic-authors-source.json", "http://localhost:8083/connectors" } -task loadMarkLogicEmployeesSourceConnector(type: Exec) { +tasks.register("loadMarkLogicEmployeesSourceConnector", Exec) { commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json", "--data", "@ConfluentConnectorConfigs/marklogic-employees-source.json", "http://localhost:8083/connectors" } -task insertAuthors(type: Test) { +tasks.register("insertAuthors", Test) { useJUnitPlatform() systemProperty "AUTHOR_IDS", authorIds description = "Insert a new author into the data-hub-STAGING database via a new citations XML document; " + @@ -47,7 +47,7 @@ task insertAuthors(type: Test) { include "com/marklogic/kafka/connect/source/debug/InsertAuthorsTest.class" } -task loadMarkLogicDHPurchasesSinkConnector(type: Exec) { +tasks.register("loadMarkLogicDHPurchasesSinkConnector", Exec) { description = "Load an instance of the MarkLogic Kafka connector into Confluent Platform for writing data to " + "MarkLogic from the 'purchases' topic" commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json",