Skip to content

Commit f034c22

Browse files
committed
Bump to commons-email2
1 parent d6e7164 commit f034c22

56 files changed

Lines changed: 259 additions & 258 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

conf/spotbugs-exclude-filter.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
<!-- the javadoc states that the default character encoding is used -->
3030
<!-- when converting a string into a byte[] -->
3131
<Match>
32-
<Class name="org.apache.commons.mail.util.MimeMessageUtils" />
33-
<Method name="createMimeMessage" params="javax.mail.Session, java.lang.String" returns="javax.mail.internet.MimeMessage" />
32+
<Class name="org.apache.commons.mail2.util.MimeMessageUtils" />
33+
<Method name="createMimeMessage" params="jakarta.mail.Session, java.lang.String" returns="jakarta.mail.internet.MimeMessage" />
3434
<Bug pattern="DM_DEFAULT_ENCODING" />
3535
</Match>
3636

3737
<!-- printStackTrace is supposed to use the default character encoding -->
3838
<Match>
39-
<Class name="org.apache.commons.mail.EmailException" />
39+
<Class name="org.apache.commons.mail2.EmailException" />
4040
<Method name="printStackTrace" params="java.io.PrintStream" returns="void" />
4141
<Bug pattern="DM_DEFAULT_ENCODING" />
4242
</Match>

pom.xml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
<version>56</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
25-
<artifactId>commons-email</artifactId>
26-
<version>1.6.0-SNAPSHOT</version>
25+
<artifactId>commons-email2</artifactId>
26+
<version>2.0.0-SNAPSHOT</version>
2727
<name>Apache Commons Email</name>
2828

2929
<inceptionYear>2001</inceptionYear>
3030
<description>
3131
Apache Commons Email aims to provide an API for sending email. It is built on top of
32-
the JavaMail API, which it aims to simplify.
32+
the JakartaMail API, which it aims to simplify.
3333
</description>
3434

3535
<url>https://commons.apache.org/proper/commons-email/</url>
@@ -239,13 +239,17 @@
239239
<name>Vegard Stuen</name>
240240
<email>vegard.stuen@gmail.com</email>
241241
</contributor>
242+
<contributor>
243+
<name>Réda Housni Alaoui</name>
244+
<email>reda-alaoui@hey.com</email>
245+
</contributor>
242246
</contributors>
243247

244248
<dependencies>
245249
<dependency>
246-
<groupId>com.sun.mail</groupId>
247-
<artifactId>jakarta.mail</artifactId>
248-
<version>1.6.7</version>
250+
<groupId>org.eclipse.angus</groupId>
251+
<artifactId>angus-mail</artifactId>
252+
<version>2.0.1</version>
249253
</dependency>
250254
<dependency>
251255
<groupId>org.junit.jupiter</groupId>
@@ -271,9 +275,9 @@
271275
<scope>test</scope>
272276
</dependency>
273277
<dependency>
274-
<groupId>org.subethamail</groupId>
278+
<groupId>com.github.davidmoten</groupId>
275279
<artifactId>subethasmtp</artifactId>
276-
<version>3.1.7</version>
280+
<version>6.0.5</version>
277281
<scope>test</scope>
278282
<exclusions>
279283
<exclusion>
@@ -308,13 +312,13 @@
308312
<maven.compiler.source>1.8</maven.compiler.source>
309313
<maven.compiler.target>1.8</maven.compiler.target>
310314
<commons.componentid>email</commons.componentid>
311-
<commons.module.name>org.apache.commons.mail</commons.module.name>
315+
<commons.module.name>org.apache.commons.mail2</commons.module.name>
312316
<commons.jira.id>EMAIL</commons.jira.id>
313317
<commons.jira.pid>12310474</commons.jira.pid>
314318
<commons.release.version>1.6.0</commons.release.version>
315319
<commons.release.desc>(Java 8)</commons.release.desc>
316320
<commons.rc.version>RC1</commons.rc.version>
317-
<commons.bc.version>1.5</commons.bc.version>
321+
<commons.bc.version>2.0.0-SNAPSHOT</commons.bc.version>
318322

319323
<!-- override the default commons encoding property -->
320324
<commons.encoding>UTF-8</commons.encoding>
@@ -324,16 +328,16 @@
324328
</properties>
325329

326330
<build>
327-
<defaultGoal>clean verify apache-rat:check japicmp:cmp pmd:check pmd:cpd-check spotbugs:check javadoc:javadoc</defaultGoal>
331+
<defaultGoal>clean verify apache-rat:check pmd:check pmd:cpd-check spotbugs:check javadoc:javadoc</defaultGoal>
328332
<plugins>
329333
<plugin>
330334
<groupId>org.apache.maven.plugins</groupId>
331335
<artifactId>maven-surefire-plugin</artifactId>
332336
<configuration>
333337
<!-- exclude test case support classes -->
334338
<excludes>
335-
<exclude>org/apache/commons/mail/mocks/*</exclude>
336-
<exclude>org/apache/commons/mail/settings/*</exclude>
339+
<exclude>org/apache/commons/mail2/mocks/*</exclude>
340+
<exclude>org/apache/commons/mail2/settings/*</exclude>
337341
<exclude>**/Abstract*Test.java</exclude>
338342
</excludes>
339343
</configuration>
@@ -536,6 +540,7 @@
536540
--add-opens java.base/java.util.regex=ALL-UNNAMED
537541
--add-opens java.base/java.nio.charset=ALL-UNNAMED
538542
--add-opens java.base/sun.nio.cs=ALL-UNNAMED
543+
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
539544
--add-opens java.logging/java.util.logging=ALL-UNNAMED
540545
</argLine>
541546
</configuration>

src/main/java/org/apache/commons/mail/ByteArrayDataSource.java renamed to src/main/java/org/apache/commons/mail2/ByteArrayDataSource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.commons.mail;
17+
package org.apache.commons.mail2;
1818

1919
import java.io.BufferedInputStream;
2020
import java.io.BufferedOutputStream;
@@ -25,7 +25,7 @@
2525
import java.io.OutputStream;
2626
import java.io.UnsupportedEncodingException;
2727

28-
import javax.activation.DataSource;
28+
import jakarta.activation.DataSource;
2929

3030
/**
3131
* This class implements a typed DataSource from:<br>
@@ -39,7 +39,7 @@
3939
* and it is recommended to do so.
4040
*
4141
* @since 1.0
42-
* @deprecated since 1.4, use {@link javax.mail.util.ByteArrayDataSource} instead
42+
* @deprecated since 1.4, use {@link jakarta.mail.util.ByteArrayDataSource} instead
4343
*/
4444
@Deprecated
4545
public class ByteArrayDataSource implements DataSource
@@ -55,7 +55,7 @@ public class ByteArrayDataSource implements DataSource
5555

5656
/**
5757
* The name associated with this data source.
58-
* By default, the name is an empty string, similar to javax.mail.util.ByteArrayDataSource.
58+
* By default, the name is an empty string, similar to jakarta.mail.util.ByteArrayDataSource.
5959
* @since 1.3.1
6060
*/
6161
private String name = "";

src/main/java/org/apache/commons/mail/DataSourceResolver.java renamed to src/main/java/org/apache/commons/mail2/DataSourceResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.commons.mail;
17+
package org.apache.commons.mail2;
1818

19-
import javax.activation.DataSource;
19+
import jakarta.activation.DataSource;
2020
import java.io.IOException;
2121

2222
/**

src/main/java/org/apache/commons/mail/DefaultAuthenticator.java renamed to src/main/java/org/apache/commons/mail2/DefaultAuthenticator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.commons.mail;
17+
package org.apache.commons.mail2;
1818

19-
import javax.mail.Authenticator;
20-
import javax.mail.PasswordAuthentication;
19+
import jakarta.mail.Authenticator;
20+
import jakarta.mail.PasswordAuthentication;
2121

2222
/**
2323
* This is a very simple authentication object that can be used for any

src/main/java/org/apache/commons/mail/Email.java renamed to src/main/java/org/apache/commons/mail2/Email.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.commons.mail;
17+
package org.apache.commons.mail2;
1818

1919
import java.io.UnsupportedEncodingException;
2020
import java.nio.charset.Charset;
@@ -26,22 +26,22 @@
2626
import java.util.Map;
2727
import java.util.Properties;
2828

29-
import javax.mail.Authenticator;
30-
import javax.mail.Message;
31-
import javax.mail.MessagingException;
32-
import javax.mail.Session;
33-
import javax.mail.Store;
34-
import javax.mail.Transport;
35-
import javax.mail.internet.AddressException;
36-
import javax.mail.internet.InternetAddress;
37-
import javax.mail.internet.MimeMessage;
38-
import javax.mail.internet.MimeMultipart;
39-
import javax.mail.internet.MimeUtility;
29+
import jakarta.mail.Authenticator;
30+
import jakarta.mail.Message;
31+
import jakarta.mail.MessagingException;
32+
import jakarta.mail.Session;
33+
import jakarta.mail.Store;
34+
import jakarta.mail.Transport;
35+
import jakarta.mail.internet.AddressException;
36+
import jakarta.mail.internet.InternetAddress;
37+
import jakarta.mail.internet.MimeMessage;
38+
import jakarta.mail.internet.MimeMultipart;
39+
import jakarta.mail.internet.MimeUtility;
4040
import javax.naming.Context;
4141
import javax.naming.InitialContext;
4242
import javax.naming.NamingException;
4343

44-
import org.apache.commons.mail.util.IDNEmailAddressConverter;
44+
import org.apache.commons.mail2.util.IDNEmailAddressConverter;
4545

4646
/**
4747
* The base class for all email messages. This class sets the
@@ -597,7 +597,7 @@ public void setMailSession(final Session aSession)
597597
/**
598598
* Supply a mail Session object from a JNDI directory.
599599
*
600-
* @param jndiName name of JNDI resource (javax.mail.Session type), resource
600+
* @param jndiName name of JNDI resource (jakarta.mail.Session type), resource
601601
* if searched in java:comp/env if name does not start with "java:"
602602
* @throws IllegalArgumentException if the JNDI name is null or empty
603603
* @throws NamingException if the resource cannot be retrieved from JNDI directory
@@ -857,7 +857,7 @@ public Email addTo(final String email, final String name, final String charset)
857857
* @param aCollection collection of {@code InternetAddress} objects.
858858
* @return An Email.
859859
* @throws EmailException Indicates an invalid email address.
860-
* @see javax.mail.internet.InternetAddress
860+
* @see jakarta.mail.internet.InternetAddress
861861
* @since 1.0
862862
*/
863863
public Email setTo(final Collection<InternetAddress> aCollection) throws EmailException
@@ -966,7 +966,7 @@ public Email addCc(final String email, final String name, final String charset)
966966
* @param aCollection collection of {@code InternetAddress} objects.
967967
* @return An Email.
968968
* @throws EmailException Indicates an invalid email address.
969-
* @see javax.mail.internet.InternetAddress
969+
* @see jakarta.mail.internet.InternetAddress
970970
* @since 1.0
971971
*/
972972
public Email setCc(final Collection<InternetAddress> aCollection) throws EmailException
@@ -1075,7 +1075,7 @@ public Email addBcc(final String email, final String name, final String charset)
10751075
* @param aCollection collection of {@code InternetAddress} objects
10761076
* @return An Email.
10771077
* @throws EmailException Indicates an invalid email address
1078-
* @see javax.mail.internet.InternetAddress
1078+
* @see jakarta.mail.internet.InternetAddress
10791079
* @since 1.0
10801080
*/
10811081
public Email setBcc(final Collection<InternetAddress> aCollection) throws EmailException
@@ -1154,7 +1154,7 @@ public Email addReplyTo(final String email, final String name, final String char
11541154
* @param aCollection collection of {@code InternetAddress} objects
11551155
* @return An Email.
11561156
* @throws EmailException Indicates an invalid email address
1157-
* @see javax.mail.internet.InternetAddress
1157+
* @see jakarta.mail.internet.InternetAddress
11581158
* @since 1.1
11591159
*/
11601160
public Email setReplyTo(final Collection<InternetAddress> aCollection) throws EmailException
@@ -1785,7 +1785,7 @@ public boolean isSendPartial()
17851785
* Sets whether the email is partially send in case of invalid addresses.
17861786
* <p>
17871787
* In case the mail server rejects an address as invalid, the call to {@link #send()}
1788-
* may throw a {@link javax.mail.SendFailedException}, even if partial send mode is enabled (emails
1788+
* may throw a {@link jakarta.mail.SendFailedException}, even if partial send mode is enabled (emails
17891789
* to valid addresses will be transmitted). In case the email server does not reject
17901790
* invalid addresses immediately, but return a bounce message, no exception will be thrown
17911791
* by the {@link #send()} method.

src/main/java/org/apache/commons/mail/EmailAttachment.java renamed to src/main/java/org/apache/commons/mail2/EmailAttachment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.commons.mail;
17+
package org.apache.commons.mail2;
1818

1919
import java.net.URL;
2020

@@ -26,10 +26,10 @@
2626
public class EmailAttachment
2727
{
2828
/** Definition of the part being an attachment. */
29-
public static final String ATTACHMENT = javax.mail.Part.ATTACHMENT;
29+
public static final String ATTACHMENT = jakarta.mail.Part.ATTACHMENT;
3030

3131
/** Definition of the part being inline. */
32-
public static final String INLINE = javax.mail.Part.INLINE;
32+
public static final String INLINE = jakarta.mail.Part.INLINE;
3333

3434
/** The name of this attachment. */
3535
private String name = "";

src/main/java/org/apache/commons/mail/EmailConstants.java renamed to src/main/java/org/apache/commons/mail2/EmailConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.commons.mail;
17+
package org.apache.commons.mail2;
1818

1919
/**
2020
* Constants used by Email classes.

src/main/java/org/apache/commons/mail/EmailException.java renamed to src/main/java/org/apache/commons/mail2/EmailException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.commons.mail;
18+
package org.apache.commons.mail2;
1919

2020
import java.io.OutputStreamWriter;
2121
import java.io.PrintStream;

src/main/java/org/apache/commons/mail/EmailUtils.java renamed to src/main/java/org/apache/commons/mail2/EmailUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.commons.mail;
18+
package org.apache.commons.mail2;
1919

2020
import java.io.File;
2121
import java.io.IOException;
2222
import java.io.UnsupportedEncodingException;
2323
import java.util.BitSet;
2424
import java.util.Random;
2525

26-
import javax.mail.MessagingException;
27-
import javax.mail.internet.MimeMessage;
26+
import jakarta.mail.MessagingException;
27+
import jakarta.mail.internet.MimeMessage;
2828

29-
import org.apache.commons.mail.util.MimeMessageUtils;
29+
import org.apache.commons.mail2.util.MimeMessageUtils;
3030

3131
/**
3232
* Utility methods used by commons-email.

0 commit comments

Comments
 (0)