After you update your code and your tests are green, you are ready to release a new Java 17-compatible version of your custom connector.
-
To communicate Java 17 compatibility, generate metadata for Java compatibility of your custom connector by adding or upgrading the custom connector mule-sdk-api dependency to the latest version:
<dependency>
<groupId>org.mule.sdk</groupId>
<artifactId>mule-sdk-api</artifactId>
<version>0.10.1</version>
</dependency>
-
For Java SDK, add the @JavaVersionSupport annotation in the same class as the @Extension annotation and include the JAVA_17 value, for example:
|
|
You don’t need to add any annotations for XML SDK because XML SDK modules are Java 17 compatible and inherit the property automatically.
|
@Extension(name = "Database")
@Operations(...)
@JavaVersionSupport({JAVA_8, JAVA_11, JAVA_17})
public class DatabaseConnector {
..
}
In Mule 4.5.0 and later, custom connectors that don’t specify the @JavaVersionSupport annotation are assumed to be compatible with Java 8 and Java 11.
You can mark your custom connector as compatible with Java 17 only; however, you must ensure that no adoption or backward compatibility issues exist.
When you deploy a Mule app, Mule verifies that all modules in the Mule app are compatible with the Java version. If Mule finds an incompatibility, Mule throws an error and the application does not deploy.
|
|
If you receive an error message specific to an XML SDK based connector, such as Extension 'module-error-handler-plugin' does not support Java 17. Supported versions are: [1.8, 11], this means that your Mule app still contains some connectors that are not compatible with Java 17. To resolve this error, upgrade all connectors in your Mule app to be compatible with Java 17.
|
If your code is compatible with Java 17 but you don’t declare Java 17 compatibility, you can still get a successful test run.
To run a quick check on your custom connector or if all dependencies are not ready, pass the following argument to skip hard checks on the Java support declaration:
-M-Dmule.jvm.version.extension.enforcement=LOOSE