Servlet-api should only be used during compilation and is not needed during runtime as it is provided by container
This commit is forcing jakarta.servlet:jakarta.servlet-api to be resolved as an api dependency in several locations
Numerous dependencies should not be part of the final build:
configurations {
all {
exclude group: "jakarta.servlet", module: "jakarta.servlet-api"
exclude group: "org.glassfish.jaxb", module: "jaxb-runtime"
exclude group: "org.junit.jupiter", module: "junit-jupiter-api"
exclude group: "org.apache.ant", module: "ant"
exclude group: "org.springframework", module: "spring-test"
exclude group: "org.hibernate", module: "hibernate-core" // dependency of eh-cache, not hibernate-core-jakarta
exclude group: "jakarta.el", module: "jakarta.el-api"
exclude group: "org.fusesource.jansi", module: "jansi" // developmentOnly
exclude group: "org.apache.groovy", module: "groovy-ant" // developmentOnly
}
}
This should NOT be solved with exclusions. Dependencies should not be included in fhe first place.
Similar problem in 6.2.x https://github.com/grails/grails-core/issues/13745 that has existing since 5.0.0
This commit is forcing jakarta.servlet:jakarta.servlet-api to be resolved as an api dependency in several locations
PR #13545 updated the dependency from javax.servlet to jakarta.servlet, but did not modify the dependency configuration. Adjusting the configuration was outside the scope of this PR.
The most BASIC Grails 5.3.6 app requires 177 jar files and is 75M (grails create-app) The most BASIC Grails 6.2.1 app requires 174 jar files and is 133M (grails create-app) The most BASIC Spring Boot 3.3.4 app requires 31 jar files and is 19M (spring init --dependencies=web)
https://github.com/apache/grails-core/pull/14970