Skip to content

spring-boot-starter-oauth2-client has an unnecessary dependency on com.sun.mail:jakarta.mail #28308

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

Closed
wants to merge 1 commit into from

Conversation

martin-v
Copy link
Contributor

oauth2-client don't depend on any mail dependency, so it's just confusing and causing problems with javax.mail.* to jakarta.mail.* package name change.

Was introduced with d6a869f, probably there are more similar cases.

oauth2-client don't depend on any mail dependency, so it's just confusing and causing problems with `javax.mail.*` to `jakarta.mail.*` package name change.

Was introduced with d6a869f, probably there are more similar cases.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 13, 2021
@wilkinsona
Copy link
Member

Thanks for the PR.

At the time of d6a869f, com.sun.mail:javax.mail was a dependency of the managed version of oauth2-oidc-sdk. This meant that the made in that commit were necessary to replace the javax.mail dependency with its jakarta.mail equivalent. It looks like this stopped being the case in Spring Boot 2.4 when we upgraded to 8.23 of the OIDC SDK which no longer has the mail dependency but we missed it.

probably there are more similar cases.

Can you expand a bit on this, please? If there are other cases, it'd be good to address them as well but I don't understand why you think they're likely.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Oct 13, 2021
@martin-v
Copy link
Contributor Author

Thanks for the fast response.

Can you expand a bit on this, please? If there are other cases, it'd be good to address them as well but I don't understand why you think they're likely.

I just took a quick look at the commit d6a869f and saw that there are more exclude/add cases similar to one I reverted in the PR. So I guessed that it is possible that here are more cases where the exclude/add is no longer necessary. E.g. the upstream project uses the jakarta version by itself now. (would be just a code smell, because the dependency is still necessary) or as in this PR case the dependency is obsolete now. But I didn't check any other cases.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Oct 13, 2021
@wilkinsona wilkinsona changed the title Remove unnecessary mail dependency in spring-boot-starter-oauth2-client spring-boot-starter-oauth2-client has an unnecessary dependency on com.sun.mail:jakarta.mail Oct 14, 2021
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Oct 14, 2021
@wilkinsona wilkinsona self-assigned this Oct 14, 2021
@wilkinsona wilkinsona added this to the 2.4.x milestone Oct 14, 2021
@wilkinsona
Copy link
Member

Thanks, @martin-v. I think we could add a custom Gradle task to detect unnecessary exclusions. That may then help us to spot places where we've done an unnecessary addition too. I've opened #28332.

@wilkinsona
Copy link
Member

@martin-v Thanks very much for making your first contribution to Spring Boot.

@martin-v
Copy link
Contributor Author

Thanks, it was a pleasure :)

@martin-v martin-v deleted the patch-1 branch October 14, 2021 14:59
martin-v added a commit to martin-v/spring-boot that referenced this pull request Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants