JavaMail API from Maven

后端 未结 1 911
野趣味
野趣味 2020-12-09 01:19

I am trying to upgrade to latest Java Mail utility.

From


    javax.mail
    mail         


        
相关标签:
1条回答
  • 2020-12-09 01:43

    The Maven coordinates changed some time ago to be compatible with the scheme described here. The new coordinates are here.

    In short:

    • The groupId javax.mail is no longer used for the implementation.
    • There is a new artifact at javax.mail:javax.mail-api. It provides the javax.mail-api.jar file. This contains the JavaMail API definitions only, suitable for compiling against.
    • com.sun.mail:javax.mail contains the javax.mail.jar file, the JavaMail reference implementation jar file, including the SMTP, IMAP, and POP3 protocol providers.

    So, you should either use com.sun.mail:javax.mail for compilation and packaging/deploy, or use javax.mail:javax.mail-api for compilation and then deploy the com.sun.mail:javax.mail jar where appropriate (e.g., your Tomcat lib).

    0 讨论(0)
提交回复
热议问题