Skip to content

Conversation

@BillFarber
Copy link
Contributor

This also forces the use of Java 17 for tests.

This clears up all the Spring Framework risks in BlackDuck.

This also forces the use of Java 17 for tests.
@BillFarber BillFarber requested review from anu3990, Copilot, rjrudin and stevebio and removed request for anu3990 and stevebio August 7, 2025 13:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@BillFarber BillFarber changed the title Force Spring Framework to v6 in tests. MLE-23405 - Force Spring Framework to v6 in tests. Aug 7, 2025
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.

// 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.'
    }
  }
}

@BillFarber
Copy link
Contributor Author

Closing since Spring is also a dependency of ml-app-deployer, which would force the runtime to also be Java 17 and we don't want that yet.

@BillFarber BillFarber closed this Aug 7, 2025
@BillFarber BillFarber deleted the task/forceSpring6InTests branch August 7, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants