While deploying a custom connector asset to Exchange using Maven, it fails with "The asset metadata is invalid, There was an error while trying to extract the metadata for extension" error message:
2023-10-02 12:19:35:304 [main] [DEBUG] An error occurred while loading the Extension descriptions file
(...)
Caused by: java.lang.RuntimeException: Publication ended with errors: [The asset metadata is invalid, There was an error while trying to extract the metadata for extension: { groupId: ***, assetId: mulesoft-custom-connector, version: 1.0.0 }]
The error comes from Exchange platform when trying to compile with JDK 8 and finding an error. Custom connectors are developed using the Mule SDK, and need to be compile with JDK 8 as stated in MuleSoft documentation:
The maximum supported version for Java SDK is JDK 11, however, you can use JDK 11 only for running your application. Compilation with Java SDK must be done with JDK 8.
If there was no issue shown during development is because the local machine was using a higher Java JDK version.
Make the customer connector compile with JDK 8 by removing dependencies that need newest Java versions.
001117501

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.