A required class was missing while executing org.wso2.maven:wso2-esb-api-plugin:2.1.0:pom-gen: javax/activation/DataSource

--

Issue : Following is a build error received when building a CAR project.

[ERROR] Failed to execute goal org.wso2.maven:wso2-esb-api-plugin:2.1.0:pom-gen (api) on project TESTESB: Execution api of goal org.wso2.maven:wso2-esb-api-plugin:2.1.0:pom-gen failed: A required class was missing while executing org.wso2.maven:wso2-esb-api-plugin:2.1.0:pom-gen: javax/activation/DataSource
[ERROR] -----------------------------------------------------
[ERROR] realm = extension>org.wso2.maven:wso2-esb-api-plugin:2.1.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
Environment setup => java version : 17.0.1
maven version : Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
operating system : macOS Big Sur

Cause and resolution:

In this case of Maven, we specify the compiler plugin to use Maven with Java 17. Here the plugin does not support Java 17 which causes the issue. Downgraded the java version to the most commonly used java version “1.8.0_301" which resolved the issue.

--

--