Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servlet-api should only be used during compilation and is not needed during runtime as it is provided by container #13746

Open
codeconsole opened this issue Oct 12, 2024 · 3 comments
Assignees

Comments

@codeconsole
Copy link
Contributor

codeconsole commented Oct 12, 2024

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.

@codeconsole
Copy link
Contributor Author

codeconsole commented Oct 12, 2024

Similar problem in 6.2.x #13745 that has existing since 5.0.0

@matrei
Copy link
Contributor

matrei commented Oct 12, 2024

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.

@codeconsole
Copy link
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants