Skip to content

Migrate to jakarta package namespace ( and commons-email2 )#133

Closed
reda-alaoui wants to merge 2 commits intoapache:masterfrom
Cosium:commons-email2
Closed

Migrate to jakarta package namespace ( and commons-email2 )#133
reda-alaoui wants to merge 2 commits intoapache:masterfrom
Cosium:commons-email2

Conversation

@reda-alaoui
Copy link
Member

@reda-alaoui reda-alaoui commented Jan 21, 2023

This PR fully migrates the project to jakarta package namespace .
It also introduces commons-email2 as asked by #80 (comment)

Please note I removed japicmp from the defaultGoal in absence of a better known solution. Otherwise, japicmp fails the build for breaking changes.

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.52%. Comparing base (0de8743) to head (61c2bac).
Report is 491 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #133      +/-   ##
============================================
- Coverage     65.90%   65.52%   -0.38%     
+ Complexity      305      303       -2     
============================================
  Files            18       18              
  Lines          1053     1053              
  Branches        138      138              
============================================
- Hits            694      690       -4     
- Misses          280      283       +3     
- Partials         79       80       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MaximeEsnol
Copy link

So are there any plans to merge this pull request or is this library going to stay on outdated Java EE forever?

@garydgregory
Copy link
Member

@MaximeEsnol
So creating a major new release line is work we perform rarely and with deliberate intent, not as a knee jerk reaction. Since we are all volunteers, we must consider how to best use our time to support existing legacy users and the ones building on the latest environments. So it will happen eventually I am sure. When a new major release is planned is also the time when we can break binary compatibility, so this is when we reasses the public and protected elements of the component. I hope this helps you understand where we are coming from.

@ebourg
Copy link
Member

ebourg commented Feb 6, 2023

commons-email is a fairly small library, it could be possible to support both JEE namespaces with the same jar. New classes using the jakarta namespace would go into a different package, for example org.apache.commons.email.jakarta.

@sebbASF
Copy link
Contributor

sebbASF commented Feb 6, 2023

Might be better to release as a separate jar.

But I agree it is not appropriate to drop support for javax.mail just yet.

@sebbASF
Copy link
Contributor

sebbASF commented Feb 6, 2023

Or indeed if the only change is the package name, then one could presumably use Maven Shade to generate a parallel jar

@ahill-vtinfo
Copy link

Are there any rough plans for timing on this?

Understand that this change must be very deliberate per @garydgregory, but with the forced migration to Spring Boot 3.0 later this year(based on 2.7 end of life) which has a Jakarta EE 9 baseline - it seems like applications will be forced off of this library.

sschuberth added a commit to oss-review-toolkit/ort that referenced this pull request Mar 6, 2023
The use of `jakarta.mail` and its predecessor `javax.mail` cannot be
mixed. As GreenMail 2.0 migrated to `jakarta.mail` [1] but `commons-email`
does not support `jakarta.mail` yet [2], simply remove `commons-email`
in favor of using `jakarta.mail` directly to resolve the conflict.

For simplicity, this also slightly changes the behavior: In case of a
plain text email, the email is now sent as single-part instead of
multi-part.

[1]: https://github.com/greenmail-mail-test/greenmail/releases/tag/release-2.0.0
[2]: apache/commons-email#133

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this pull request Mar 6, 2023
The use of `jakarta.mail` and its predecessor `javax.mail` cannot be
mixed. As GreenMail 2.0 migrated to `jakarta.mail` [1] but `commons-email`
does not support `jakarta.mail` yet [2], simply remove `commons-email`
in favor of using `jakarta.mail` directly to resolve the conflict.

For simplicity, this also slightly changes the behavior: In case of a
plain-text email, the email is now sent as single-part instead of
multi-part.

[1]: https://github.com/greenmail-mail-test/greenmail/releases/tag/release-2.0.0
[2]: apache/commons-email#133

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this pull request Mar 6, 2023
The use of `jakarta.mail` and its predecessor `javax.mail` cannot be
mixed. As GreenMail 2.0 migrated to `jakarta.mail` [1] but `commons-email`
does not support `jakarta.mail` yet [2], simply remove `commons-email`
in favor of using `jakarta.mail` directly to resolve the conflict.

For simplicity, this also slightly changes the behavior: In case of a
plain-text email, the email is now sent as single-part instead of
multi-part.

[1]: https://github.com/greenmail-mail-test/greenmail/releases/tag/release-2.0.0
[2]: apache/commons-email#133

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this pull request Mar 6, 2023
The use of `jakarta.mail` and its predecessor `javax.mail` cannot be
mixed. As GreenMail 2.0 migrated to `jakarta.mail` [1] but `commons-email`
does not support `jakarta.mail` yet [2], simply remove `commons-email`
in favor of using `jakarta.mail` directly to resolve the conflict.

For simplicity, this also slightly changes the behavior: In case of a
plain-text email, the email is now sent as single-part instead of
multi-part.

[1]: https://github.com/greenmail-mail-test/greenmail/releases/tag/release-2.0.0
[2]: apache/commons-email#133

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this pull request Mar 9, 2023
The use of `jakarta.mail` and its predecessor `javax.mail` cannot be
mixed. As GreenMail 2.0 migrated to `jakarta.mail` [1] but `commons-email`
does not support `jakarta.mail` yet [2], simply remove `commons-email`
in favor of using `jakarta.mail` directly to resolve the conflict.

For simplicity, this also slightly changes the behavior: In case of a
plain-text email, the email is now sent as single-part instead of
multi-part.

[1]: https://github.com/greenmail-mail-test/greenmail/releases/tag/release-2.0.0
[2]: apache/commons-email#133

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@Wade-tech
Copy link

which commons-email version support jakarta?

@reda-alaoui reda-alaoui marked this pull request as draft June 17, 2023 15:56
@reda-alaoui reda-alaoui marked this pull request as ready for review June 17, 2023 16:05
@Loki-Afro
Copy link
Contributor

looking forward to this one, can i somehow support you in getting this pr done?

@garydgregory
Copy link
Member

FTR, -1 on this PR. I propose we take the same approach as Apache Commons FileUpload (see that master branch).

@times29
Copy link

times29 commented Jul 30, 2023

+1 for this PR :)

@fak98
Copy link

fak98 commented Jul 31, 2023

+1 for this PR too. We need this as it's blocking us from upgrading to Jetty 11. How does this get progressed?

@garydgregory
Copy link
Member

The next release will support Jakarta but not this way. See my previous comment. I should be able to work on this within a week or two.

@JanCizmar
Copy link

JanCizmar commented Oct 10, 2023

Hey! week or two already passed! Any news to support jakarta API?

@fak98
Copy link

fak98 commented Oct 10, 2023 via email

@garydgregory
Copy link
Member

Hey! week or two already passed! Any news to support jakarta API?

Hey! We're all volunteers with different priorities than yours ;-)

@JanCizmar
Copy link

Understood. Thanks for your work! ✅ Is there any workaround I can get attachments from jakarta.mail.internet.MimeMessage?

@Loki-Afro
Copy link
Contributor

@garydgregory as i said 2 prs earlier, i'm happy to help. and this is still blocking me in a few projects to upgrade to spring 3.x :/ so is there any update? how can i help?

@garydgregory
Copy link
Member

garydgregory commented Dec 12, 2023

Hello @Loki-Afro,

This is my current plan:

  1. Re-enable HtmlEmailTest, ImageHtmlEmailTest, MultiPartEmailTest, and port these to JUnit 5.
  2. Create a release candidate for 1.6.0
  3. Increase Commons Email to 2.0.0
  4. Refactor the project to use Jakarta and Javax in the same style as Commons FileUpload 2.0.0-M1 (git master).
  5. Release 2.0.0-M1
  6. Monitor feedback

I need help with (1), please feel free to contribute a PR.

@Loki-Afro
Copy link
Contributor

@garydgregory here you go #186

@Loki-Afro
Copy link
Contributor

@garydgregory let me know if i can assist further, maybe with 4.?

@garydgregory
Copy link
Member

garydgregory commented Dec 14, 2023

I don't want to mix up the steps, especially if something goes wrong before 1.6, I don't want to deal with patching branches. If all goes well, I'll create a release candidate for 1.6.0 this Friday or Saturday.

@omasseau
Copy link

omasseau commented Jan 15, 2024

EDIT: Nevermind, found the answer here : https://issues.apache.org/jira/browse/EMAIL-203
-> 1.6.0 is not compatible and we have to wait for 2.0.0 ;)

Hello,

Just to be sure to understand. Is version 1.6.0 compatible with Jakarta EE 9+ now ?
I have some doubt as when looking at the dependencies of https://mvnrepository.com/artifact/org.apache.commons/commons-email/1.6.0 it seems to have jakarta.mail:1.6.7 as a dependency but Jakarte EE 9+ requires at least jakarta.mail 2.0.

@dwickern
Copy link
Contributor

That confused me too. Despite its name, jakarta.mail 1.6.7 has javax.mail packages and not jakarta.mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.