Which artifact for org.springframework.mail?

JavaSpringMaven 2Jakarta Mail

Java Problem Overview


I'd like to use spring support for sending mails. My project is built with maven-2 and I use spring-core 2.5.5 I tried to look in maven central repo for artifact to include in my pom.xml, and the only one I found is spring support. The problem is that the highest version in repo is 2.0.8 and it depends on spring-core v. 2.0.8. Should I add it and exclude from its dependencies spring-core, spring-aop and so on, or should I look for another artifact (but which one will do?) or use another repo? Which is the proper maven-2 artifact for org.springframework.mail and where can I find it?

Java Solutions


Solution 1 - Java

The mail stuff is found, rather bizarrely, in the context-support artifact.

Solution 2 - Java

 <!-- ########### SPRING-CONTEXT-SUPPORT ############ -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>

Solution 3 - Java

For using MailSender and SimpleMailMessage through Spring you can use these imports in your code:

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

And add their jars in your project.

Otherwise if you are using maven then you have to make these imports in your source and then add dependencies :

  1. http://mvnrepository.com/artifact/org.springframework/spring-support/2.0.6
  2. http://mvnrepository.com/artifact/org.springframework/spring-context-support/3.2.0.RELEASE

You will get the mail support from both of them.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTadeusz Kopec for UkraineView Question on Stackoverflow
Solution 1 - JavaskaffmanView Answer on Stackoverflow
Solution 2 - JavaWillEnsabaView Answer on Stackoverflow
Solution 3 - JavaPawan SaxenaView Answer on Stackoverflow