Пониженная версия jakarta.servlet не работает для тестовых случаев весной 3. ⇐ JAVA
-
Anonymous
Пониженная версия jakarta.servlet не работает для тестовых случаев весной 3.
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
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
Мобильная версия