Skip to content

Commit

Permalink
Migrate to Jakarta Mail
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jan 21, 2022
1 parent df16025 commit a7940d9
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 44 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@
<scope>provided</scope>
</dependency>
<!--
This must come before javax-mail-api in the class path in order to avoid eclipse-ee4j/mail#350.
This must come before jakarta-mail-api in the class path in order to avoid eclipse-ee4j/mail#350.
-->
<dependency>
<groupId>org.jvnet.mock-javamail</groupId>
<artifactId>mock-javamail</artifactId>
<version>1.12</version>
<version>2.0</version>
<scope>test</scope>
</dependency>
<!--
This must come after mock-javamail in the class path in order to avoid eclipse-ee4j/mail#350.
-->
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>javax-mail-api</artifactId>
<version>1.6.2-5</version>
<artifactId>jakarta-mail-api</artifactId>
<version>2.0.0-5</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/cli/MailCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import hudson.Extension;
import jenkins.model.Jenkins;

import javax.mail.internet.MimeMessage;
import javax.mail.Transport;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.Transport;

/**
* Sends e-mail through Jenkins.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/hudson/tasks/MailSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import javax.mail.Address;
import javax.mail.MessagingException;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import jakarta.mail.Address;
import jakarta.mail.MessagingException;
import jakarta.mail.Transport;
import jakarta.mail.internet.AddressException;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/hudson/tasks/Mailer.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@
import java.util.logging.Logger;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import javax.mail.Address;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import jakarta.mail.Address;
import jakarta.mail.Authenticator;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.PasswordAuthentication;
import jakarta.mail.Session;
import jakarta.mail.Transport;
import jakarta.mail.internet.AddressException;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;

import org.apache.tools.ant.types.selectors.SelectorUtils;
import org.kohsuke.accmod.Restricted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.mail.internet.InternetAddress;
import jakarta.mail.internet.InternetAddress;

/**
* Checks email addresses if they should be excluded from sent emails.
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/jenkins/plugins/mailer/tasks/MimeMessageBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
import org.jenkinsci.main.modules.instance_identity.InstanceIdentity;

import edu.umd.cs.findbugs.annotations.NonNull;
import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.internet.AddressException;
import javax.mail.internet.HeaderTokenizer;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeUtility;
import jakarta.mail.Address;
import jakarta.mail.BodyPart;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Multipart;
import jakarta.mail.internet.AddressException;
import jakarta.mail.internet.HeaderTokenizer;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeBodyPart;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMultipart;
import jakarta.mail.internet.MimeUtility;

import java.io.UnsupportedEncodingException;
import java.security.interfaces.RSAPublicKey;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/hudson/tasks/MailerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
import org.jvnet.hudson.test.recipes.LocalData;
import org.jvnet.mock_javamail.Mailbox;

import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import jakarta.mail.Address;
import jakarta.mail.internet.InternetAddress;

import jenkins.model.Jenkins;
import jenkins.model.JenkinsLocationConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import java.util.List;
import java.util.Set;

import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import jakarta.mail.internet.AddressException;
import jakarta.mail.internet.InternetAddress;

import jenkins.model.Jenkins;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
import org.jvnet.mock_javamail.Mailbox;
import org.kohsuke.stapler.framework.io.WriterOutputStream;

import javax.mail.Address;
import javax.mail.Message;
import javax.mail.Transport;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import jakarta.mail.Address;
import jakarta.mail.Message;
import jakarta.mail.Transport;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMultipart;

import java.io.StringWriter;
import java.security.KeyFactory;
Expand Down

0 comments on commit a7940d9

Please sign in to comment.