Skip to content
Closed
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
17 changes: 14 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ plugins {
// id "com.github.davidmc24.gradle.plugin.avro" version "1.6.0"
}

// With the upgrade to Spring Framework v6, we need to use Java 17 or later.
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
Copy link
Contributor

Choose a reason for hiding this comment

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

These need to stay on Java 8 so that the 1.11.0 release still supports Java 8.

The way to do this is to use a toolchain:

java {
  // Must use Java 17 as Spring 6 requires Java 17. 
  toolchain {
    languageVersion = JavaLanguageVersion.of(17)
  }
}

That forces users - i.e. us and Jenkins - to use Java 17 or later to build and run the tests. But this block ensures that the connector still runs on Java 8.

targetCompatibility = 17
}

repositories {
Expand All @@ -32,12 +33,22 @@ configurations {
// 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 'org.apache.commons:commons-collections4:4.5.0'

// Force v3.18 of commons-lang3 to avoid CVE-2025-48924
// (https://www.cve.org/CVERecord?id=CVE-2025-48924), without also
// upgrading ml-app-deployer to 6.0.0, which we are not ready to do yet.
force 'org.apache.commons:commons-lang3:3.18.0'

// Force Spring Framework v6 to avaoid CVEs in v5.3.9 and earlier.
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a configurations block instead - it avoids the brittleness of trying to list every Spring dependency, and it also allows for explaining what's going on - e.g.

configurations.all {
  resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    if (details.requested.group.startsWith('org.springframework')) {
      details.useVersion '6.2.9'
      details.because 'Forcing usage of Spring 6 to minimize vulnerabilities.'
    }
  }
}

// These dependencies are used by marklogic-junit5.
force 'org.springframework:spring-aop:6.2.9'
force 'org.springframework:spring-beans:6.2.9'
force 'org.springframework:spring-context:6.2.9'
force 'org.springframework:spring-core:6.2.9'
force 'org.springframework:spring-expression:6.2.9'
force 'org.springframework:spring-test:6.2.9'
force 'org.springframework:spring-web:6.2.9'
}
}
}
Expand Down
Loading