Question
How should I package my user code jar for Ververica Platform?
Answer
Note: This section applies to Ververica Platform 2.0 or later.
User code jars packaged for Ververica Platform should contain all user dependencies but should not include any classes from the Flink runtime. Ververica Platform provides images that already contain the Flink runtime and bundling it in your code may lead to classpath errors or other unexpected behavior.
To do so, please mark core Flink dependencies such as `flink-java` and `flink-streaming-java` as `provided` in your build:
<dependencies> <!-- Apache Flink Dependencies --> <!-- These dependencies are provided, because they should not be packaged into the JAR file. --> <dependency> <groupId>org.apache.flink</groupId> <!-- Remove the Scala version suffix if you are using Flink 1.15 or later --> <artifactId>flink-streaming-java_2.11</artifactId> <version>${flink.version}</version> <scope>provided</scope> </dependency> </dependencies>
For more examples, please see the project configuration documentation on the Apache Flink website.