Пониженная версия jakarta.servlet не работает для тестовых случаев весной 3.JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Пониженная версия jakarta.servlet не работает для тестовых случаев весной 3.

Сообщение Anonymous »


I am facing an issue by running an application and running the test cases.

Issue is like I am running spring 3.1.4 and since to support jakarta.servlet in spring boot I have to use jakarta.servlet 5.0.0.

By default spring 3 support 6.0.0 but the time of release there was no jetty support so need to downgrade to 5.0.0

So my application is working fine but my test cases are failing. Once I change to 6.0.0 my test cases are working fine. To solve this issue I am using something like this in my build.gradle file.

configurations { compileOnly { extendsFrom annotationProcessor } all { exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' exclude group: 'org.springframework.boot', module: 'spring-boot-starter-websocket' //exclude group: 'commons-logging', module: 'commons-logging' testImplementation.exclude group: 'org.projectlombok', module: 'lombok' testImplementation.exclude group: 'jakarta.servlet', module: 'jakarta.servlet-api' if (project.hasProperty('runTests')) { testImplementation.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' } resolutionStrategy.eachDependency { details -> if (details.requested.group == 'jakarta.servlet') { // to support jetty on spring boot 3.1.4 //details.useVersion '5.0.0' if (project.hasProperty('runTests')) { details.useVersion '6.0.0' }else{ details.useVersion '5.0.0' } } } } } But I am getting the similar issue. Any resolution for this ?


Источник: https://stackoverflow.com/questions/780 ... n-spring-3
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»