Skip to content

Commit

Permalink
Force use of jakarta servlet api version 6.0.0 in tests for spring mo…
Browse files Browse the repository at this point in the history
…cks to work
  • Loading branch information
Tara Drwenski committed Aug 19, 2024
1 parent c8c1fc2 commit 5612371
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gradle/any/shared-mvn-coords.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ext {
// gradle seems to have issues with the compileOnly configuration, so we need to provide the full maven
// coordinates for jakarta.servlet-api if the gradle plugin in applied. If we don't, we see errors like this:
depVersion.jakartaServletApi = '5.0.0'
// Spring 6.x servlet mocks require servlet 6 though it can test 5 code
depVersion.testJakartaServletApi = '6.0.0'
depVersion.hibernateValidator = '7.0.0.Final'
// TODO: figure out way to keep this version in sync with netcdf-java version
// It is included in the netcdf-java-bom (via netcdf-java-platform), but we can't
Expand Down
6 changes: 6 additions & 0 deletions tds/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ configurations.testRuntimeOnly {
exclude group: 'org.apache.logging.log4j'
}

configurations.testRuntimeClasspath {
resolutionStrategy {
force "jakarta.servlet:jakarta.servlet-api:${depVersion.testJakartaServletApi}"
}
}

task copyWebappFilesForTests(type: Copy) {
// Tests expect for certain webapp files to be accessible from the classpath (e.g. WEB-INF/applicationContext.xml).
from 'src/main/webapp'
Expand Down

0 comments on commit 5612371

Please sign in to comment.