How to download JavaMail (mail.jar) and JAF (activation.jar) using maven
Solution 1
You simply need to add this dependency to your maven project:
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.6</version>
</dependency>
No need to add activation
too (unless you want to use a specific version) as it is already a dependency of javax.mail
such that it will be added as dependency to your project by transitivity.
You can find all the artifacts' description in the home page of the javamail
project.
Solution 2
Use the following links to get the required artifacts from the maven central repository:
https://mvnrepository.com/artifact/javax.mail/mail/1.4
https://mvnrepository.com/artifact/javax.activation/activation/1.1.1
Or
Add these to your pom.xml.
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
Bill_Data23
Updated on July 05, 2022Comments
-
Bill_Data23 almost 2 years
I want to do this tutorial https://www.tutorialspoint.com/java/java_sending_email.htm about sending emails with java and the first line of the tutorial says that I need to download
JavaMail (mail.jar)
andJAF (activation.jar)
, and I want to download those jars using maven is that possible since this popular website says that is not possible http://www.mkyong.com/maven/how-to-download-javamail-api-from-maven/ , I tried searching in the maven repository but there are too many jars with the same name