Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Jakarta Mail #144

Merged
merged 4 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +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>
<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 @@ -60,16 +60,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
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 @@ -53,8 +53,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