In Appian 22.3, the mail library available for use in custom plug-ins has been updated from JavaMail (javax.mail) to Jakarta Mail (jakarta.mail). Custom plug-ins that reference the JavaMail library will need to be updated to use the Jakarta Mail library to continue to work in Appian 22.3.
javax.mail
jakarta.mail
This article outlines how to update a custom plug-in to use the Jakarta Mail library, which requires that import statements in each java class that reference the javax.mail and javax.activation packages to be updated to reference the jakarta.mail and jakarta.activation packages respectively.
javax.mail and
javax.activation
jakarta.activation
In the project build.gradle file:
dependencies { // .... other project dependencies .... compileOnly 'com.sun.mail:jakarta.mail:2.0.1' compileOnly 'com.sun.activation:jakarta.activation:2.0.1' }
In the project pom.xml file:
<dependencies> <!-- .... other project dependencies .... --> <dependency> <groupId>com.sun.mail</groupId> <artifactId>jakarta.mail</artifactId> <version>2.0.1</version> <scope>system</scope> </dependency> <dependency> <groupId>com.sun.activation</groupId> <artifactId>jakarta.activation</artifactId> <version>2.0.1</version> <scope>system</scope> </dependency> </dependencies>
Below are example steps for updating a plug-in project in Eclipse.
META-INF/lib
<LOCATION_SAVED_EARLIER>/jakarta.mail-2.0.1.jar
<LOCATION_SAVED_EARLIER>/jakarta.activation-2.0.1.jar
package com.appiancorp.plugins.example.mail; import java.util.Date; import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import org.apache.log4j.Logger;
package com.appiancorp.plugins.example.mail; import java.util.Date; import java.util.Properties; import jakarta.mail.Authenticator; import jakarta.mail.Message; import jakarta.mail.PasswordAuthentication; import jakarta.mail.Session; import jakarta.mail.Transport; import jakarta.mail.internet.InternetAddress; import jakarta.mail.internet.MimeMessage; import org.apache.log4j.Logger;
appian-plugin.xml
<version>1.0.1</version>
<version>1.1.0</version>
_admin/plugins
This article applies to Appian 22.3 and later.
Last Reviewed: September 2022