Skip to content
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
2 changes: 1 addition & 1 deletion .copyrightconfig
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
14 changes: 5 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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'
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: docker-tests-marklogic-kafka-confluent
name: docker-tests-marklogic-kafka
services:
marklogic:
image: "${MARKLOGIC_IMAGE}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcard imports should be avoided as they reduce code readability and can lead to naming conflicts. Consider importing specific classes individually.

Suggested change
import javax.xml.transform.*;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerConfigurationException;

Copilot uses AI. Check for mistakes.
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.StringWriter;
Expand All @@ -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";

Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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);
}

}
14 changes: 7 additions & 7 deletions test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,48 @@ 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; " +
"use e.g. -PauthorIds=7,8,9 to insert 3 new authors with IDs of 7, 8, and 9"
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",
Expand Down